diff mbox series

net: clear msg_get_inq in __get_compat_msghdr()

Message ID d06d0f7f-696c-83b4-b2d5-70b5f2730a37@I-love.SAKURA.ne.jp (mailing list archive)
State Accepted
Commit d547c1b717fc5a1e062307e1efdf81590ba9f6c1
Delegated to: Netdev Maintainers
Headers show
Series net: clear msg_get_inq in __get_compat_msghdr() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tetsuo Handa Sept. 14, 2022, 9:51 a.m. UTC
syzbot is still complaining uninit-value in tcp_recvmsg(), for
commit 1228b34c8d0ecf6d ("net: clear msg_get_inq in __sys_recvfrom() and
__copy_msghdr_from_user()") missed that __get_compat_msghdr() is called
instead of copy_msghdr_from_user() when MSG_CMSG_COMPAT is specified.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 1228b34c8d0ecf6d ("net: clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user()")
---
 net/compat.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jens Axboe Sept. 14, 2022, 9:54 a.m. UTC | #1
On 9/14/22 3:51 AM, Tetsuo Handa wrote:
> syzbot is still complaining uninit-value in tcp_recvmsg(), for
> commit 1228b34c8d0ecf6d ("net: clear msg_get_inq in __sys_recvfrom() and
> __copy_msghdr_from_user()") missed that __get_compat_msghdr() is called
> instead of copy_msghdr_from_user() when MSG_CMSG_COMPAT is specified.

Looks good to me:

Reviewed-by: Jens Axboe <axboe@kernel.dk>
patchwork-bot+netdevbpf@kernel.org Sept. 20, 2022, 3:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 14 Sep 2022 18:51:54 +0900 you wrote:
> syzbot is still complaining uninit-value in tcp_recvmsg(), for
> commit 1228b34c8d0ecf6d ("net: clear msg_get_inq in __sys_recvfrom() and
> __copy_msghdr_from_user()") missed that __get_compat_msghdr() is called
> instead of copy_msghdr_from_user() when MSG_CMSG_COMPAT is specified.
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Fixes: 1228b34c8d0ecf6d ("net: clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user()")
> 
> [...]

Here is the summary with links:
  - net: clear msg_get_inq in __get_compat_msghdr()
    https://git.kernel.org/netdev/net/c/d547c1b717fc

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/compat.c b/net/compat.c
index fe9be3c56ef7..385f04a6be2f 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -52,6 +52,7 @@  int __get_compat_msghdr(struct msghdr *kmsg,
 		kmsg->msg_namelen = sizeof(struct sockaddr_storage);
 
 	kmsg->msg_control_is_user = true;
+	kmsg->msg_get_inq = 0;
 	kmsg->msg_control_user = compat_ptr(msg->msg_control);
 	kmsg->msg_controllen = msg->msg_controllen;