syzbot


KMSAN: kernel-infoleak in sctp_getsockopt

Status: fixed on 2019/01/11 01:22
Subsystems: sctp
[Documentation on labels]
Reported-by: syzbot+ad5d327e6936a2e284be@syzkaller.appspotmail.com
Fix commit: 4a2eb0c37b47 sctp: initialize sin6_flowinfo for ipv6 addrs in sctp_inet6addr_event
First crash: 2032d, last: 1983d
Discussions (7)
Title Replies (including bot) Last reply
KMSAN: kernel-infoleak in sctp_getsockopt 8 (9) 2019/01/14 11:09
[PATCH 3.18 00/47] 3.18.132-stable review 52 (52) 2019/01/13 07:44
[PATCH 4.4 00/88] 4.4.170-stable review 102 (102) 2019/01/12 17:42
[PATCH 4.19 000/170] 4.19.14-stable review 194 (194) 2019/01/11 07:09
[PATCH 4.14 000/101] 4.14.92-stable review 130 (130) 2019/01/09 15:47
[PATCH 4.9 00/71] 4.9.149-stable review 85 (85) 2019/01/09 10:46
[PATCH net] sctp: initialize sin6_flowinfo for ipv6 addrs in sctp_inet6addr_event 4 (4) 2018/12/10 19:54
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: kernel-infoleak in sctp_getsockopt (2) sctp C 16 1929d 1980d 11/27 fixed on 2019/03/06 07:43
upstream KMSAN: kernel-infoleak in sctp_getsockopt (3) sctp syz 11 1894d 1906d 12/27 fixed on 2019/04/12 08:05

Sample crash report:
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
==================================================================
BUG: KMSAN: kernel-infoleak in _copy_to_user+0x19a/0x230 lib/usercopy.c:32
CPU: 1 PID: 8333 Comm: syz-executor1 Not tainted 4.20.0-rc3+ #101
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x32d/0x480 lib/dump_stack.c:113
 kmsan_report+0x12c/0x290 mm/kmsan/kmsan.c:682
 kmsan_internal_check_memory+0x32a/0xa50 mm/kmsan/kmsan.c:742
 kmsan_copy_to_user+0x78/0xd0 mm/kmsan/kmsan_hooks.c:634
 _copy_to_user+0x19a/0x230 lib/usercopy.c:32
 copy_to_user include/linux/uaccess.h:177 [inline]
 sctp_getsockopt_local_addrs net/sctp/socket.c:5998 [inline]
 sctp_getsockopt+0x14aa6/0x17740 net/sctp/socket.c:7477
 sock_common_getsockopt+0x13f/0x180 net/core/sock.c:2937
 __sys_getsockopt+0x489/0x550 net/socket.c:1939
 __do_sys_getsockopt net/socket.c:1950 [inline]
 __se_sys_getsockopt+0xe1/0x100 net/socket.c:1947
 __x64_sys_getsockopt+0x62/0x80 net/socket.c:1947
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7
RIP: 0033:0x457569
Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc1a8f25c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457569
RDX: 000000000000006d RSI: 0000000000000084 RDI: 0000000000000003
RBP: 000000000072bfa0 R08: 0000000020000000 R09: 0000000000000000
R10: 0000000020000340 R11: 0000000000000246 R12: 00007fc1a8f266d4
R13: 00000000004c87a8 R14: 00000000004ce8a0 R15: 00000000ffffffff

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:245 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:260 [inline]
 kmsan_internal_chain_origin+0x13d/0x240 mm/kmsan/kmsan.c:468
 kmsan_memcpy_memmove_metadata+0x1a9/0xf70 mm/kmsan/kmsan.c:343
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:361
 __msan_memcpy+0x61/0x70 mm/kmsan/kmsan_instr.c:148
 sctp_copy_laddrs net/sctp/socket.c:5901 [inline]
 sctp_getsockopt_local_addrs net/sctp/socket.c:5967 [inline]
 sctp_getsockopt+0x147a2/0x17740 net/sctp/socket.c:7477
 sock_common_getsockopt+0x13f/0x180 net/core/sock.c:2937
 __sys_getsockopt+0x489/0x550 net/socket.c:1939
 __do_sys_getsockopt net/socket.c:1950 [inline]
 __se_sys_getsockopt+0xe1/0x100 net/socket.c:1947
 __x64_sys_getsockopt+0x62/0x80 net/socket.c:1947
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:245 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:260 [inline]
 kmsan_internal_chain_origin+0x13d/0x240 mm/kmsan/kmsan.c:468
 kmsan_memcpy_memmove_metadata+0x1a9/0xf70 mm/kmsan/kmsan.c:343
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:361
 __msan_memcpy+0x61/0x70 mm/kmsan/kmsan_instr.c:148
 sctp_copy_laddrs net/sctp/socket.c:5890 [inline]
 sctp_getsockopt_local_addrs net/sctp/socket.c:5967 [inline]
 sctp_getsockopt+0x14649/0x17740 net/sctp/socket.c:7477
 sock_common_getsockopt+0x13f/0x180 net/core/sock.c:2937
 __sys_getsockopt+0x489/0x550 net/socket.c:1939
 __do_sys_getsockopt net/socket.c:1950 [inline]
 __se_sys_getsockopt+0xe1/0x100 net/socket.c:1947
 __x64_sys_getsockopt+0x62/0x80 net/socket.c:1947
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:245 [inline]
 kmsan_internal_poison_shadow+0x6d/0x130 mm/kmsan/kmsan.c:169
 kmsan_kmalloc+0xa1/0x100 mm/kmsan/kmsan_hooks.c:186
 __kmalloc+0x14c/0x480 mm/slub.c:3816
 kmalloc include/linux/slab.h:551 [inline]
 sctp_inetaddr_event+0x518/0xa60 net/sctp/protocol.c:779
 notifier_call_chain kernel/notifier.c:93 [inline]
 __blocking_notifier_call_chain kernel/notifier.c:317 [inline]
 blocking_notifier_call_chain+0x1a5/0x2f0 kernel/notifier.c:328
 __inet_insert_ifa+0xff8/0x1250 net/ipv4/devinet.c:529
 inet_rtm_newaddr+0x1326/0x21c0 net/ipv4/devinet.c:921
 rtnetlink_rcv_msg+0x1148/0x1540 net/core/rtnetlink.c:4947
 netlink_rcv_skb+0x394/0x640 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4965
 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
 netlink_unicast+0x1699/0x1740 net/netlink/af_netlink.c:1336
 netlink_sendmsg+0x13c7/0x1440 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:621 [inline]
 sock_sendmsg net/socket.c:631 [inline]
 ___sys_sendmsg+0xdbc/0x11d0 net/socket.c:2116
 __sys_sendmsg net/socket.c:2154 [inline]
 __do_sys_sendmsg net/socket.c:2163 [inline]
 __se_sys_sendmsg+0x305/0x460 net/socket.c:2161
 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161
 do_syscall_64+0xcf/0x110 arch/x86/entry/common.c:291
 entry_SYSCALL_64_after_hwframe+0x63/0xe7

Bytes 8-15 of 400 are uninitialized
Memory access of size 400 starts at ffff8881856d6400
Data copied to user address 0000000020000348
==================================================================

Crashes (147):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/01 07:04 https://github.com/google/kmsan.git master 9fbf73b8d4af d8988561 .config console log report syz ci-upstream-kmsan-gce
2018/11/26 14:39 https://github.com/google/kmsan.git master fffec98ae2a6 ac912200 .config console log report syz ci-upstream-kmsan-gce
2018/11/26 11:16 https://github.com/google/kmsan.git master fffec98ae2a6 ac912200 .config console log report syz ci-upstream-kmsan-gce
2018/11/26 01:14 https://github.com/google/kmsan.git master fffec98ae2a6 3d3ec907 .config console log report syz ci-upstream-kmsan-gce
2019/01/10 15:55 https://github.com/google/kmsan.git master 9945cd9f64dc db9b6579 .config console log report ci-upstream-kmsan-gce
2019/01/10 14:13 https://github.com/google/kmsan.git master 9945cd9f64dc db9b6579 .config console log report ci-upstream-kmsan-gce
2019/01/09 18:59 https://github.com/google/kmsan.git master a6846a32c96d 45c0c1b1 .config console log report ci-upstream-kmsan-gce
2019/01/08 17:45 https://github.com/google/kmsan.git master 48128c3ca084 37dd2683 .config console log report ci-upstream-kmsan-gce
2019/01/08 02:26 https://github.com/google/kmsan.git master 48128c3ca084 69d69aa9 .config console log report ci-upstream-kmsan-gce
2019/01/07 23:24 https://github.com/google/kmsan.git master 48128c3ca084 69d69aa9 .config console log report ci-upstream-kmsan-gce
2019/01/06 18:35 https://github.com/google/kmsan.git master 11587f6ee534 94f8adb5 .config console log report ci-upstream-kmsan-gce
2019/01/06 18:26 https://github.com/google/kmsan.git master 11587f6ee534 94f8adb5 .config console log report ci-upstream-kmsan-gce
2019/01/06 13:18 https://github.com/google/kmsan.git master 11587f6ee534 94f8adb5 .config console log report ci-upstream-kmsan-gce
2019/01/06 08:23 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/06 07:18 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/05 14:29 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/05 11:16 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/05 09:28 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/05 06:10 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/05 05:01 https://github.com/google/kmsan.git master 11587f6ee534 53be0a37 .config console log report ci-upstream-kmsan-gce
2019/01/04 23:24 https://github.com/google/kmsan.git master 11587f6ee534 0127e3ba .config console log report ci-upstream-kmsan-gce
2019/01/03 18:54 https://github.com/google/kmsan.git master 68006459ade0 66fcd29b .config console log report ci-upstream-kmsan-gce
2019/01/03 12:20 https://github.com/google/kmsan.git master 8ba10281f9e5 66fcd29b .config console log report ci-upstream-kmsan-gce
2019/01/03 06:17 https://github.com/google/kmsan.git master 8ba10281f9e5 06a2b89f .config console log report ci-upstream-kmsan-gce
2019/01/03 04:46 https://github.com/google/kmsan.git master 8ba10281f9e5 06a2b89f .config console log report ci-upstream-kmsan-gce
2019/01/03 03:55 https://github.com/google/kmsan.git master 8ba10281f9e5 06a2b89f .config console log report ci-upstream-kmsan-gce
2019/01/03 00:31 https://github.com/google/kmsan.git master 8ba10281f9e5 06a2b89f .config console log report ci-upstream-kmsan-gce
2019/01/02 14:10 https://github.com/google/kmsan.git master 8ba10281f9e5 f0491811 .config console log report ci-upstream-kmsan-gce
2019/01/02 12:44 https://github.com/google/kmsan.git master 8ba10281f9e5 f0491811 .config console log report ci-upstream-kmsan-gce
2019/01/02 11:41 https://github.com/google/kmsan.git master 8ba10281f9e5 f0491811 .config console log report ci-upstream-kmsan-gce
2019/01/02 08:39 https://github.com/google/kmsan.git master 8ba10281f9e5 3d85f48c .config console log report ci-upstream-kmsan-gce
2019/01/01 13:32 https://github.com/google/kmsan.git master 8ba10281f9e5 3d85f48c .config console log report ci-upstream-kmsan-gce
2019/01/01 11:14 https://github.com/google/kmsan.git master 8ba10281f9e5 3d85f48c .config console log report ci-upstream-kmsan-gce
2019/01/01 04:31 https://github.com/google/kmsan.git master 8ba10281f9e5 3d85f48c .config console log report ci-upstream-kmsan-gce
2019/01/01 02:20 https://github.com/google/kmsan.git master 8ba10281f9e5 3d85f48c .config console log report ci-upstream-kmsan-gce
2018/12/31 15:50 https://github.com/google/kmsan.git master 8ba10281f9e5 2b42fdc8 .config console log report ci-upstream-kmsan-gce
2018/12/30 20:56 https://github.com/google/kmsan.git master 8ba10281f9e5 9942de5f .config console log report ci-upstream-kmsan-gce
2018/12/30 17:59 https://github.com/google/kmsan.git master 8ba10281f9e5 9942de5f .config console log report ci-upstream-kmsan-gce
2018/12/30 16:43 https://github.com/google/kmsan.git master 8ba10281f9e5 9942de5f .config console log report ci-upstream-kmsan-gce
2018/12/28 22:07 https://github.com/google/kmsan.git master 79fc24ff6184 fc6ae81a .config console log report ci-upstream-kmsan-gce
2018/12/28 07:22 https://github.com/google/kmsan.git master 79fc24ff6184 af317504 .config console log report ci-upstream-kmsan-gce
2018/12/28 04:20 https://github.com/google/kmsan.git master 79fc24ff6184 af317504 .config console log report ci-upstream-kmsan-gce
2018/12/26 18:51 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/26 17:22 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/26 16:14 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/26 14:16 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/26 09:15 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/25 22:38 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/25 07:32 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/24 23:43 https://github.com/google/kmsan.git master 79fc24ff6184 8a41a0ad .config console log report ci-upstream-kmsan-gce
2018/12/24 14:38 https://github.com/google/kmsan.git master e9021948e109 be79df56 .config console log report ci-upstream-kmsan-gce
2018/11/22 19:19 https://github.com/google/kmsan.git master 50031178f793 2ee77802 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.