syzbot


KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb (5)

Status: fixed on 2023/10/12 12:48
Subsystems: net
[Documentation on labels]
Fix commit: f866fbc842de ipv4: fix data-races around inet->inet_id
First crash: 344d, last: 304d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb net 1 728d 724d 0/26 auto-closed as invalid on 2022/07/03 10:30
upstream KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb (3) net 1 591d 591d 0/26 auto-obsoleted due to no activity on 2022/11/16 18:44
upstream KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb (4) net 4 467d 518d 0/26 auto-obsoleted due to no activity on 2023/04/02 09:13
upstream KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb (2) net 1 635d 635d 0/26 auto-closed as invalid on 2022/10/03 20:50

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb

write to 0xffff888141e3f02a of 2 bytes by task 7232 on cpu 0:
 __ip4_datagram_connect+0x759/0x7b0 net/ipv4/datagram.c:76
 ip4_datagram_connect+0x2e/0x40 net/ipv4/datagram.c:90
 inet_dgram_connect+0x114/0x1a0 net/ipv4/af_inet.c:580
 __sys_connect_file net/socket.c:1992 [inline]
 __sys_connect+0x1a1/0x1b0 net/socket.c:2009
 __do_sys_connect net/socket.c:2019 [inline]
 __se_sys_connect net/socket.c:2016 [inline]
 __x64_sys_connect+0x41/0x50 net/socket.c:2016
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888141e3f02a of 2 bytes by task 7238 on cpu 1:
 ip_select_ident_segs include/net/ip.h:541 [inline]
 ip_select_ident include/net/ip.h:556 [inline]
 __ip_make_skb+0x817/0xc70 net/ipv4/ip_output.c:1437
 ip_make_skb+0x233/0x2c0 net/ipv4/ip_output.c:1551
 udp_sendmsg+0x1199/0x1250 net/ipv4/udp.c:1256
 inet_sendmsg+0x63/0x80 net/ipv4/af_inet.c:830
 sock_sendmsg_nosec net/socket.c:725 [inline]
 sock_sendmsg net/socket.c:748 [inline]
 sock_write_iter+0x1aa/0x230 net/socket.c:1129
 call_write_iter include/linux/fs.h:1871 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x4ab/0x7d0 fs/read_write.c:584
 ksys_write+0xeb/0x1a0 fs/read_write.c:637
 __do_sys_write fs/read_write.c:649 [inline]
 __se_sys_write fs/read_write.c:646 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:646
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x545b -> 0x8ecb

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 7238 Comm: syz-executor.3 Not tainted 6.5.0-rc3-syzkaller-00024-g18b44bc5a672 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/26 16:52 upstream 18b44bc5a672 41fe1bae .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb
2023/07/12 23:12 upstream 3f01e9fed845 979d5fe2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb
2023/06/17 09:11 upstream 1639fae5132b f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __ip4_datagram_connect / __ip_make_skb
* Struck through repros no longer work on HEAD.