Re: [PATCH v6 4/7] pidfd: Replace open-coded partial receive_fd()

2020-07-09 Thread Christian Brauner
On Wed, Jul 08, 2020 at 11:35:39PM -0700, Kees Cook wrote: > On Tue, Jul 07, 2020 at 02:22:20PM +0200, Christian Brauner wrote: > > So while the patch is correct it leaves 5.6 and 5.7 with a bug in the > > pidfd_getfd() implementation and that just doesn't seem right. I'm > > wondering whether we s

Re: [PATCH v6 4/7] pidfd: Replace open-coded partial receive_fd()

2020-07-08 Thread Kees Cook
On Tue, Jul 07, 2020 at 02:22:20PM +0200, Christian Brauner wrote: > So while the patch is correct it leaves 5.6 and 5.7 with a bug in the > pidfd_getfd() implementation and that just doesn't seem right. I'm > wondering whether we should introduce: > > void sock_update(struct file *file) > { >

Re: [PATCH v6 4/7] pidfd: Replace open-coded partial receive_fd()

2020-07-08 Thread Kees Cook
On Tue, Jul 07, 2020 at 02:22:20PM +0200, Christian Brauner wrote: > On Mon, Jul 06, 2020 at 01:17:17PM -0700, Kees Cook wrote: > > The sock counting (sock_update_netprioidx() and sock_update_classid()) was > > missing from pidfd's implementation of received fd installation. Replace > > the open-co

Re: [PATCH v6 4/7] pidfd: Replace open-coded partial receive_fd()

2020-07-07 Thread Christian Brauner
On Mon, Jul 06, 2020 at 01:17:17PM -0700, Kees Cook wrote: > The sock counting (sock_update_netprioidx() and sock_update_classid()) was > missing from pidfd's implementation of received fd installation. Replace > the open-coded version with a call to the new receive_fd() > helper. > > Thanks to Va

[PATCH v6 4/7] pidfd: Replace open-coded partial receive_fd()

2020-07-06 Thread Kees Cook
The sock counting (sock_update_netprioidx() and sock_update_classid()) was missing from pidfd's implementation of received fd installation. Replace the open-coded version with a call to the new receive_fd() helper. Thanks to Vamshi K Sthambamkadi for catching a missed fput() in an earlier version