Re: [PATCH] fs: split receive_fd_replace from __receive_fd

2021-04-16 Thread Christian Brauner
turning (2) into an error (-EBADF is what you'd get from > attempt to set something at such descriptor) and seeing if anything > breaks. And having SECCOMP_ADDFD_FLAG_SETFD status passed into kaddfd > explicitly, with explicit check in seccomp_handle_addfd(). As in > > commit 42

Re: [PATCH] fs: split receive_fd_replace from __receive_fd

2021-04-15 Thread Al Viro
breaks. And having SECCOMP_ADDFD_FLAG_SETFD status passed into kaddfd explicitly, with explicit check in seccomp_handle_addfd(). As in commit 42eb0d54c08a0331d6d295420f602237968d792b Author: Christoph Hellwig Date: Thu Mar 25 09:22:09 2021 +0100 fs: split receive_fd_replace from __receive_fd

Re: [PATCH] fs: split receive_fd_replace from __receive_fd

2021-04-15 Thread Al Viro
On Thu, Mar 25, 2021 at 09:22:09AM +0100, Christoph Hellwig wrote: > receive_fd_replace shares almost no code with the general case, so split > it out. Also remove the "Bump the sock usage counts" comment from > both copies, as that is now what __receive_sock actually does. Nice, except that

Re: [PATCH] fs: split receive_fd_replace from __receive_fd

2021-04-02 Thread Kees Cook
On Thu, Mar 25, 2021 at 09:22:09AM +0100, Christoph Hellwig wrote: > receive_fd_replace shares almost no code with the general case, so split > it out. Also remove the "Bump the sock usage counts" comment from > both copies, as that is now what __receive_sock actually does. > > Signed-off-by:

Re: split receive_fd_replace from __receive_fd

2021-03-25 Thread Christian Brauner
On Thu, Mar 25, 2021 at 09:22:08AM +0100, Christoph Hellwig wrote: > The receive_fd_replace case shares almost no logic with the more general > __receive_fd case, so split it into a separate function. > > BTW, I'm not sure if receive_fd_replace is such a useful primitive to > start with, why not

split receive_fd_replace from __receive_fd

2021-03-25 Thread Christoph Hellwig
The receive_fd_replace case shares almost no logic with the more general __receive_fd case, so split it into a separate function. BTW, I'm not sure if receive_fd_replace is such a useful primitive to start with, why not just open code it in seccomp?

[PATCH] fs: split receive_fd_replace from __receive_fd

2021-03-25 Thread Christoph Hellwig
receive_fd_replace shares almost no code with the general case, so split it out. Also remove the "Bump the sock usage counts" comment from both copies, as that is now what __receive_sock actually does. Signed-off-by: Christoph Hellwig --- fs/file.c| 39