Bug 9778 - Samba directory code uses dirfd() without vectoring through a VFS call.
Summary: Samba directory code uses dirfd() without vectoring through a VFS call.
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: VFS Modules (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 9777
Blocks: 9822
  Show dependency treegraph
 
Reported: 2013-04-09 23:08 UTC by Jeremy Allison
Modified: 2021-02-11 14:03 UTC (History)
3 users (show)

See Also:


Attachments
git-am fix for master and 4.0.x (4.50 KB, patch)
2013-04-11 19:01 UTC, Jeremy Allison
no flags Details
git-am fix for master and 4.0.next. (4.75 KB, patch)
2013-04-11 19:51 UTC, Jeremy Allison
asn: review-
Details
git-am fix for 4.0.next. (5.38 KB, patch)
2013-04-23 15:41 UTC, Jeremy Allison
asn: review+
Details
Additional git-am fix that needs to be applied on top of the 4.0.x patch. (868 bytes, patch)
2013-04-26 18:40 UTC, Jeremy Allison
no flags Details
git-am fix for 4.0.next that went into master. (6.61 KB, patch)
2013-04-29 20:55 UTC, Jeremy Allison
ddiss: review+
Details
v3-6-test patch (6.86 KB, patch)
2013-06-05 05:55 UTC, Andreas Schneider
jra: review+
ddiss: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2013-04-09 23:08:19 UTC
This breaks VFS modules that return an opaque pointer, cast to a DIR * - such as vfs_scannedonly.c and potentially others.

Patch to follow that removes the use of dirfd() from the samba code.

This is related to bug 9777, which also has a patch to remove dirfd use from the vfs_dirsort module.

Jeremy.
Comment 1 Jeremy Allison 2013-04-11 19:01:02 UTC
Created attachment 8760 [details]
git-am fix for master and 4.0.x

Patchset to remove all uses of dirfd() from the main Samba code.
Jeremy.
Comment 2 Jeremy Allison 2013-04-11 19:51:45 UTC
Created attachment 8762 [details]
git-am fix for master and 4.0.next.

Updated - remove obsolete comment on sys_fdopendir().
Comment 3 Andreas Schneider 2013-04-16 07:30:58 UTC
Comment on attachment 8762 [details]
git-am fix for master and 4.0.next.

Please cherry-pick the patches from master.
Comment 4 Andreas Schneider 2013-04-23 07:50:55 UTC
Jeremy :)
Comment 5 Jeremy Allison 2013-04-23 15:41:16 UTC
Created attachment 8806 [details]
git-am fix for 4.0.next.
Comment 6 Andreas Schneider 2013-04-24 07:20:56 UTC
Comment on attachment 8806 [details]
git-am fix for 4.0.next.

LGTM.
Comment 7 Volker Lendecke 2013-04-24 09:46:26 UTC
Just a quick comment: I would like bug 9822 to be understood before this goes in. The reporter's analysis points at the dirfd patchset. Unfortunately, I've not been able to work on this more yet.
Comment 8 Jeremy Allison 2013-04-24 15:27:11 UTC
Seems reasonable to me. Looking at #9822 does look like this broke something, but the reporter still hasn't provided a usable backtrace.

I'll look at this bug also.

Cheers,

Jeremy.
Comment 9 Jeremy Allison 2013-04-26 18:40:21 UTC
Created attachment 8822 [details]
Additional git-am fix that needs to be applied on top of the 4.0.x patch.

This is the fix for bug #9822 that also need to be applied on top of the git-am fix for 4.0.x. Both fixes are required (or I can squash into one if the reviewer requests).

Jeremy.
Comment 10 Jeremy Allison 2013-04-29 20:55:51 UTC
Created attachment 8829 [details]
git-am fix for 4.0.next that went into master.

Contains the "cherry picked from commit" references from master.

Please +1 and let's get this into 4.0.next.

Also contains the fix for 9822 as it logically belongs here.

Jeremy.
Comment 11 David Disseldorp 2013-04-30 10:38:29 UTC
Comment on attachment 8829 [details]
git-am fix for 4.0.next that went into master.

OpenDir_fsp() falls back to SMB_VFS_OPENDIR() if SMB_VFS_FDOPENDIR() fails with ENOSYS. Shouldn't dirp->fsp also be set in this case?
Comment 12 David Disseldorp 2013-04-30 10:46:03 UTC
(In reply to comment #11)
> Comment on attachment 8829 [details]
> git-am fix for 4.0.next that went into master.
> 
> OpenDir_fsp() falls back to SMB_VFS_OPENDIR() if SMB_VFS_FDOPENDIR() fails with
> ENOSYS. Shouldn't dirp->fsp also be set in this case?

Forget it, there's no fd to track in this case.
Comment 13 David Disseldorp 2013-04-30 10:46:25 UTC
Comment on attachment 8829 [details]
git-am fix for 4.0.next that went into master.

Looks good.
Comment 14 Jeremy Allison 2013-04-30 16:57:58 UTC
Re-assigning to Karolin for inclusion in 4.0.next.

Thanks !

Jeremy.
Comment 15 Karolin Seeger 2013-05-06 19:19:54 UTC
Pushed to autobuild-v4-0-test.
Comment 16 Karolin Seeger 2013-05-08 19:28:09 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!
Comment 17 Anand Avati 2013-05-29 21:18:09 UTC
This issue was encountered in v3-6-stable branch as well, while testing vfs_glusterfs - https://lists.samba.org/archive/samba-technical/2013-May/092891.html and previous messages

Requesting backport to v3-6-stable.
Comment 18 Andreas Schneider 2013-06-05 05:55:28 UTC
Created attachment 8942 [details]
v3-6-test patch
Comment 19 Andreas Schneider 2013-06-05 09:53:16 UTC
Re-assigning to Karolin for inclusion in v3-6-test.

Thanks !

Andreas.
Comment 20 Karolin Seeger 2013-06-05 10:01:39 UTC
Pushed to v3-6-test.
Closing out bug report.

Thanks!
Comment 21 Jeremy Allison 2013-06-05 11:34:56 UTC
Comment on attachment 8942 [details]
v3-6-test patch

LGTM