Closed cpaasch closed 3 years ago
Different, but probably the same:
Syzkaller hit 'memory leak in inet_create' bug.
2020/11/16 22:10:29 executed programs: 61
2020/11/16 22:10:44 executed programs: 78
2020/11/16 22:10:58 executed programs: 99
2020/11/16 22:11:17 executed programs: 109
BUG: memory leak
unreferenced object 0xffff88810661e000 (size 4096):
comm "syz-executor.5", pid 5068, jiffies 4295916275 (age 86.677s)
hex dump (first 32 bytes):
00 00 00 00 e0 00 00 02 00 00 00 00 00 00 20 4e .............. N
02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<00000000b9898130>] kmalloc include/linux/slab.h:557 [inline]
[<00000000b9898130>] sk_prot_alloc.isra.0+0x1bd/0x260 net/core/sock.c:1666
[<000000004b8e9e59>] sk_alloc+0x33/0x870 net/core/sock.c:1720
[<00000000e808c08b>] inet_create net/ipv4/af_inet.c:325 [inline]
[<00000000e808c08b>] inet_create+0x34e/0xd90 net/ipv4/af_inet.c:248
[<000000000961befb>] __sock_create+0x3e6/0x6c0 net/socket.c:1427
[<000000007ec59eaf>] sock_create net/socket.c:1478 [inline]
[<000000007ec59eaf>] __sys_socket+0xef/0x200 net/socket.c:1520
[<00000000abfd6bd0>] __do_sys_socket net/socket.c:1529 [inline]
[<00000000abfd6bd0>] __se_sys_socket net/socket.c:1527 [inline]
[<00000000abfd6bd0>] __x64_sys_socket+0x6f/0xb0 net/socket.c:1527
[<00000000b80e0ad4>] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
[<00000000ff96c59b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Syzkaller reproducer:
# {Threaded:true Collide:true Repeat:true RepeatTimes:0 Procs:8 Sandbox:none Fault:false FaultCall:-1 FaultNth:0 Leak:true NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false USB:false VhciInjection:false Wifi:false Sysctl:true UseTmpDir:true HandleSegv:true Repro:false Trace:false}
r0 = socket$inet_mptcp(0x2, 0x1, 0x106)
bind$inet(r0, &(0x7f00000013c0)={0x2, 0x4e20, @multicast2}, 0x10)
connect$inet(r0, &(0x7f0000000040)={0x2, 0x4e20, @loopback}, 0x4d)
setsockopt$inet_MCAST_JOIN_GROUP(r0, 0x0, 0x2a, 0x0, 0x0)
@cpaasch may you check if this patches fix the two issues your reported please?
(soon in the export branch, max 1h)
Thanks Paolo for the fix!
Yes, issue is fixed!
Reproducer
HEAD: 2d7e2cfcc130 ("DO-NOT-MERGE: mptcp: enabled by default") (HEAD, tag: export/20201105T061029, mptcp_net-next/export) (7 days ago)
b05f8b3a652b ("DO-NOT-MERGE: mptcp: use kmalloc on kasan build") (7 days ago)
10caf376e969 ("mptcp: track window announced to peer") (7 days ago)
418ca1fe433b ("selftests: mptcp: add ADD_ADDR IPv6 test cases") (7 days ago)
1eedcb850333 ("mptcp: send out dedicated ADD_ADDR packet") (7 days ago)
e88e50820922 ("mptcp: change add_addr_signal type") (7 days ago)
318dfb33afd5 ("mptcp: keep unaccepted MPC subflow into join list") (7 days ago)
11643ffeba22 ("selftests: mptcp: add link failure test case") (7 days ago)
a7bd7ed62509 ("mptcp: skip to next candidate if subflow has unacked data") (7 days ago)
bb42d1416bf8 ("mptcp: send explicit ack on delayed ack_seq incr") (7 days ago)
36c6e9976eae ("mptcp: keep track of advertised windows right edge") (7 days ago)
e518da8ade94 ("mptcp: rework poll+nospace handling") (7 days ago)
e81af88302e1 ("mptcp: try to push pending data on snd una updates") (7 days ago)
1cd22284eda5 ("mptcp: move page frag allocation in mptcp_sendmsg()") (7 days ago)
92fd8af5e25f ("mptcp: refactor shutdown and close") (7 days ago)
404eb18a6379 ("mptcp: introduce MPTCP snd_nxt") (7 days ago)
8521f48a11fc ("mptcp: add accounting for pending data") (7 days ago)
00637a928c4c ("mptcp: reduce the arguments of mptcp_sendmsg_frag") (7 days ago)
63f59dabb61e ("mptcp: introduce mptcp_schedule_work") (7 days ago)
6f83f9992bc0 ("tcp: factor out __tcp_close() helper") (7 days ago)
46e323657c32 ("mptcp: use tcp_build_frag()") (7 days ago)
b7cfbf903413 ("tcp: factor out tcp_build_frag()") (7 days ago)
74c0724344d8 ("bpf:selftests: add bpf_mptcp_sock() verifier tests") (7 days ago)
c82968a5ca08 ("bpf:selftests: add MPTCP test base") (7 days ago)
238fb240869b ("bpf: add 'bpf_mptcp_sock' structure and helper") (7 days ago)
66e73408b5b2 ("mptcp: attach subflow socket to parent cgroup") (7 days ago)
2295ca4483a4 ("bpf: expose is_mptcp flag to bpf_tcp_sock") (7 days ago)
b65ca4c38875 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next") (mptcp_net-next/net-next) (8 days ago)