Re: [PATCH v6 3/7] fs: Add receive_fd() wrapper for __receive_fd()

2020-07-08 Thread Kees Cook
On Tue, Jul 07, 2020 at 01:49:23PM +0200, Christian Brauner wrote: > On Mon, Jul 06, 2020 at 01:17:16PM -0700, Kees Cook wrote: > > For both pidfd and seccomp, the __user pointer is not used. Update > > __receive_fd() to make writing to ufd optional via a NULL check. However, > > for the receive_fd

Re: [PATCH v6 3/7] fs: Add receive_fd() wrapper for __receive_fd()

2020-07-07 Thread Christian Brauner
On Mon, Jul 06, 2020 at 01:17:16PM -0700, Kees Cook wrote: > For both pidfd and seccomp, the __user pointer is not used. Update > __receive_fd() to make writing to ufd optional via a NULL check. However, > for the receive_fd_user() wrapper, ufd is NULL checked so an -EFAULT > can be returned to avo

Re: [PATCH v6 3/7] fs: Add receive_fd() wrapper for __receive_fd()

2020-07-06 Thread Christoph Hellwig
On Mon, Jul 06, 2020 at 01:17:16PM -0700, Kees Cook wrote: > For both pidfd and seccomp, the __user pointer is not used. Update > __receive_fd() to make writing to ufd optional via a NULL check. However, > for the receive_fd_user() wrapper, ufd is NULL checked so an -EFAULT > can be returned to avo

[PATCH v6 3/7] fs: Add receive_fd() wrapper for __receive_fd()

2020-07-06 Thread Kees Cook
For both pidfd and seccomp, the __user pointer is not used. Update __receive_fd() to make writing to ufd optional via a NULL check. However, for the receive_fd_user() wrapper, ufd is NULL checked so an -EFAULT can be returned to avoid changing the SCM_RIGHTS interface behavior. Add new wrapper rece