Message ID | 20141005162317.GA12566@lst.de |
---|---|
State | New |
Headers | show |
On Sun, Oct 05, 2014 at 06:23:17PM +0200, Christoph Hellwig wrote: > On Sun, Oct 05, 2014 at 12:13:58PM -0400, Rich Felker wrote: > > Yes, the lack of support for fchown, fchmod, fstat, fstatfs, fchdir, > > fstat, fstatfs and fchdir are already support on O_PATH descriptos, and > below is an untested patch for fchmod and fchown. Can you verify that this is enough to get full O_SEARCH semantics from the kernel? I can submit this one ASAP, and then we can try to help to make the new execveat suitable for O_EXEC.
On Thu, Oct 23, 2014 at 10:00:34AM +0200, Christoph Hellwig wrote: > On Sun, Oct 05, 2014 at 06:23:17PM +0200, Christoph Hellwig wrote: > > On Sun, Oct 05, 2014 at 12:13:58PM -0400, Rich Felker wrote: > > > Yes, the lack of support for fchown, fchmod, fstat, fstatfs, fchdir, > > > > fstat, fstatfs and fchdir are already support on O_PATH descriptos, and > > below is an untested patch for fchmod and fchown. > > Can you verify that this is enough to get full O_SEARCH semantics from > the kernel? I can submit this one ASAP, and then we can try to help to > make the new execveat suitable for O_EXEC. I've got a lot of things I'm working on at the moment, but I'll try to give it a test maybe early next week. Is that soon enough? Rich
On Thu, Oct 23, 2014 at 12:37:23PM -0400, Rich Felker wrote: > On Thu, Oct 23, 2014 at 10:00:34AM +0200, Christoph Hellwig wrote: > > On Sun, Oct 05, 2014 at 06:23:17PM +0200, Christoph Hellwig wrote: > > > On Sun, Oct 05, 2014 at 12:13:58PM -0400, Rich Felker wrote: > > > > Yes, the lack of support for fchown, fchmod, fstat, fstatfs, fchdir, > > > > > > fstat, fstatfs and fchdir are already support on O_PATH descriptos, and > > > below is an untested patch for fchmod and fchown. > > > > Can you verify that this is enough to get full O_SEARCH semantics from > > the kernel? I can submit this one ASAP, and then we can try to help to > > make the new execveat suitable for O_EXEC. > > I've got a lot of things I'm working on at the moment, but I'll try to > give it a test maybe early next week. Is that soon enough? Hmm, looking again it looks like it's not so much a matter of testing the patch as verifying that there are no other missing cases. Is that right? Let me know if I'm misunderstanding what you want. Rich
On Thu, Oct 23, 2014 at 12:38:33PM -0400, Rich Felker wrote: > > I've got a lot of things I'm working on at the moment, but I'll try to > > give it a test maybe early next week. Is that soon enough? > > Hmm, looking again it looks like it's not so much a matter of testing > the patch as verifying that there are no other missing cases. Is that > right? Let me know if I'm misunderstanding what you want. I'm pretty sure that patch works for those two syscalls, but independent verification is always welcome. The more important bit would be a list of remaining workaround you have to implement O_SEARCH (I think that should be it) and O_EXEC. For O_EXEC I suspect right now you don't have any other workaround either given the /proc based fexecve implementation, but just at the same time we're now getting a syscall for that one, so we'll have to take care of that. For O_EXEC with a syscall-based fexecve we'll probably need the O_PATH|3 defintion and some hacky looking code in the kernel I fear, so it would be great if you could bring that up in the current discussion of the execveat system call.
diff --git a/fs/open.c b/fs/open.c index d6fd3ac..ee24720 100644 --- a/fs/open.c +++ b/fs/open.c @@ -512,7 +512,7 @@ out_unlock: SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode) { - struct fd f = fdget(fd); + struct fd f = fdget_raw(fd); int err = -EBADF; if (f.file) { @@ -633,7 +633,7 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) { - struct fd f = fdget(fd); + struct fd f = fdget_raw(fd); int error = -EBADF; if (!f.file)
On Sun, Oct 05, 2014 at 12:13:58PM -0400, Rich Felker wrote: > Yes, the lack of support for fchown, fchmod, fstat, fstatfs, fchdir, fstat, fstatfs and fchdir are already support on O_PATH descriptos, and below is an untested patch for fchmod and fchown.