pidfd: Add missing sock updates for pidfd_getfd()
authorKees Cook <keescook@chromium.org>
Tue, 9 Jun 2020 23:21:38 +0000 (16:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:25 +0000 (13:07 +0200)
commit08d41d0451e6a9e0a6132b0149d3edd731234fc6
tree717c25b971b2af9340c2a74c90591d44f92ca516
parent2c0ac43a7eb2525d683a2167b6b0c9a49611638d
pidfd: Add missing sock updates for pidfd_getfd()

commit 4969f8a073977123504609d7310b42a588297aa4 upstream.

The sock counting (sock_update_netprioidx() and sock_update_classid())
was missing from pidfd's implementation of received fd installation. Add
a call to the new __receive_sock() helper.

Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: 8649c322f75c ("pid: Implement pidfd_getfd syscall")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/pid.c