diff options
author | Kees Cook <keescook@chromium.org> | 2020-06-09 16:11:29 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2020-07-13 11:03:44 -0700 |
commit | c0029de50982c1fb215330a5f9d433cec0cfd8cc (patch) | |
tree | 3452e01c860c87aa389cb5f4f5f95f629173fd00 /block | |
parent | 4969f8a073977123504609d7310b42a588297aa4 (diff) | |
download | lwn-c0029de50982c1fb215330a5f9d433cec0cfd8cc.tar.gz lwn-c0029de50982c1fb215330a5f9d433cec0cfd8cc.zip |
net/scm: Regularize compat handling of scm_detach_fds()
Duplicate the cleanups from commit 2618d530dd8b ("net/scm: cleanup
scm_detach_fds") into the compat code.
Replace open-coded __receive_sock() with a call to the helper.
Move the check added in commit 1f466e1f15cf ("net: cleanly handle kernel
vs user buffers for ->msg_control") to before the compat call, even
though it should be impossible for an in-kernel call to also be compat.
Correct the int "flags" argument to unsigned int to match fd_install()
and similar APIs.
Regularize any remaining differences, including a whitespace issue,
a checkpatch warning, and add the check from commit 6900317f5eff ("net,
scm: fix PaX detected msg_controllen overflow in scm_detach_fds") which
fixed an overflow unique to 64-bit. To avoid confusion when comparing
the compat handler to the native handler, just include the same check
in the compat handler.
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
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions