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

From
Christian Brauner <hidden>
Date
2020-07-07 11:49:34
Also in
linux-fsdevel, linux-kselftest, lkml, netdev
Reply to
Kees Cook, 2020-07-06
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 avoid changing the SCM_RIGHTS interface behavior. Add
new wrapper receive_fd() for pidfd and seccomp that does not use the ufd
argument. For the new helper, the allocated fd needs to be returned on
success. Update the existing callers to handle it.

Reviewed-by: Sargun Dhillon <redacted>
Signed-off-by: Kees Cook <redacted>
---
Hm, I'm not sure why 2/7 and 3/7 aren't just one patch but ok. :)
Acked-by: Christian Brauner <redacted>
Thread (26 messages) 26 messages, 3 authors, last reply 2020-07-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help