bisecting fixing commit since fbc5fe7a54d02e11972e3b2a5ddb6ffc88162c8f building syzkaller on f879db37f90dcefb681897d2e486c11d8298cb72 testing commit fbc5fe7a54d02e11972e3b2a5ddb6ffc88162c8f with gcc (GCC) 8.1.0 kernel signature: 3b2a43c7c0a0891c79d15bebedf04128bf38cd9a all runs: crashed: WARNING in refcount_error_report testing current HEAD 4c5bf01e16a7ec59e59a38a61f793c5d1d5560c7 testing commit 4c5bf01e16a7ec59e59a38a61f793c5d1d5560c7 with gcc (GCC) 8.1.0 kernel signature: ce35b25dd731c85cf49eaa51b664d6e6db2b1a97 all runs: OK # git bisect start 4c5bf01e16a7ec59e59a38a61f793c5d1d5560c7 fbc5fe7a54d02e11972e3b2a5ddb6ffc88162c8f Bisecting: 342 revisions left to test after this (roughly 9 steps) [f14270c56125e0a3e80d89138a4c80f1a8c461b4] x86/PCI: Avoid AMD FCH XHCI USB PME# from D0 defect testing commit f14270c56125e0a3e80d89138a4c80f1a8c461b4 with gcc (GCC) 8.1.0 kernel signature: d07d9db08b24fcf90dc3905ae04124aede95a5f7 all runs: crashed: WARNING in refcount_error_report # git bisect good f14270c56125e0a3e80d89138a4c80f1a8c461b4 Bisecting: 171 revisions left to test after this (roughly 8 steps) [f6338f8a42529e6353ba8b0aaebe69fc3e8601f8] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() testing commit f6338f8a42529e6353ba8b0aaebe69fc3e8601f8 with gcc (GCC) 8.1.0 kernel signature: dab2592b3aa005b92f37ba1fdcb1dc76c711369f all runs: OK # git bisect bad f6338f8a42529e6353ba8b0aaebe69fc3e8601f8 Bisecting: 85 revisions left to test after this (roughly 7 steps) [9c996bfa0802a7d69387efc27e16dacdaa4fa227] ACPI: OSL: only free map once in osl.c testing commit 9c996bfa0802a7d69387efc27e16dacdaa4fa227 with gcc (GCC) 8.1.0 kernel signature: bea58d6cd9d24198f2fdd2ff7a5aa1b0349142f9 all runs: crashed: WARNING in refcount_error_report # git bisect good 9c996bfa0802a7d69387efc27e16dacdaa4fa227 Bisecting: 42 revisions left to test after this (roughly 6 steps) [cf9e11a310348a49ed481195ea6d686d3a3bfd1c] powerpc: Fix vDSO clock_getres() testing commit cf9e11a310348a49ed481195ea6d686d3a3bfd1c with gcc (GCC) 8.1.0 kernel signature: d4097f7c3cbc22780198d655c56648f73da94c8d all runs: crashed: WARNING in refcount_error_report # git bisect good cf9e11a310348a49ed481195ea6d686d3a3bfd1c Bisecting: 21 revisions left to test after this (roughly 5 steps) [3485dc1441b8037945a29217ab745f456f96450e] tcp: md5: fix potential overestimation of TCP option space testing commit 3485dc1441b8037945a29217ab745f456f96450e with gcc (GCC) 8.1.0 kernel signature: 49685982b9809b1e55994a24478469a39169589b all runs: crashed: WARNING in refcount_error_report # git bisect good 3485dc1441b8037945a29217ab745f456f96450e Bisecting: 10 revisions left to test after this (roughly 4 steps) [2da0e66be5f906e0ffc13f8af80d78de9cde5988] PCI: Apply Cavium ACS quirk to ThunderX2 and ThunderX3 testing commit 2da0e66be5f906e0ffc13f8af80d78de9cde5988 with gcc (GCC) 8.1.0 kernel signature: 579669b4b9943c8092d2b2faa2371006587038d0 all runs: OK # git bisect bad 2da0e66be5f906e0ffc13f8af80d78de9cde5988 Bisecting: 5 revisions left to test after this (roughly 3 steps) [7272e8e3bfa354a4f2c829a80180f01dc66d4861] inet: protect against too small mtu values. testing commit 7272e8e3bfa354a4f2c829a80180f01dc66d4861 with gcc (GCC) 8.1.0 kernel signature: 0f08ddf155689a45f640d2d9852fcfb7c0e74905 all runs: OK # git bisect bad 7272e8e3bfa354a4f2c829a80180f01dc66d4861 Bisecting: 2 revisions left to test after this (roughly 1 step) [9a8f9033dde9094f069af6d1b4e0c753b40b5dc4] tcp: fix rejected syncookies due to stale timestamps testing commit 9a8f9033dde9094f069af6d1b4e0c753b40b5dc4 with gcc (GCC) 8.1.0 kernel signature: 8dd8ad634de6d57b3443fc2858777808cb5bcee0 all runs: crashed: WARNING in refcount_error_report # git bisect good 9a8f9033dde9094f069af6d1b4e0c753b40b5dc4 Bisecting: 0 revisions left to test after this (roughly 1 step) [b8a30668954f72174bb5cd007be9351bbe31f726] tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE() testing commit b8a30668954f72174bb5cd007be9351bbe31f726 with gcc (GCC) 8.1.0 kernel signature: b0c01df4f9416a2213f7e8b121f7cb2a42490454 all runs: crashed: WARNING in refcount_error_report # git bisect good b8a30668954f72174bb5cd007be9351bbe31f726 7272e8e3bfa354a4f2c829a80180f01dc66d4861 is the first bad commit commit 7272e8e3bfa354a4f2c829a80180f01dc66d4861 Author: Eric Dumazet Date: Thu Dec 5 20:43:46 2019 -0800 inet: protect against too small mtu values. [ Upstream commit 501a90c945103e8627406763dac418f20f3837b2 ] syzbot was once again able to crash a host by setting a very small mtu on loopback device. Let's make inetdev_valid_mtu() available in include/net/ip.h, and use it in ip_setup_cork(), so that we protect both ip_append_page() and __ip_append_data() Also add a READ_ONCE() when the device mtu is read. Pairs this lockless read with one WRITE_ONCE() in __dev_set_mtu(), even if other code paths might write over this field. Add a big comment in include/linux/netdevice.h about dev->mtu needing READ_ONCE()/WRITE_ONCE() annotations. Hopefully we will add the missing ones in followup patches. [1] refcount_t: saturated; leaking memory. WARNING: CPU: 0 PID: 9464 at lib/refcount.c:22 refcount_warn_saturate+0x138/0x1f0 lib/refcount.c:22 Kernel panic - not syncing: panic_on_warn set ... CPU: 0 PID: 9464 Comm: syz-executor850 Not tainted 5.4.0-syzkaller #0 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+0x197/0x210 lib/dump_stack.c:118 panic+0x2e3/0x75c kernel/panic.c:221 __warn.cold+0x2f/0x3e kernel/panic.c:582 report_bug+0x289/0x300 lib/bug.c:195 fixup_bug arch/x86/kernel/traps.c:174 [inline] fixup_bug arch/x86/kernel/traps.c:169 [inline] do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:267 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:286 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027 RIP: 0010:refcount_warn_saturate+0x138/0x1f0 lib/refcount.c:22 Code: 06 31 ff 89 de e8 c8 f5 e6 fd 84 db 0f 85 6f ff ff ff e8 7b f4 e6 fd 48 c7 c7 e0 71 4f 88 c6 05 56 a6 a4 06 01 e8 c7 a8 b7 fd <0f> 0b e9 50 ff ff ff e8 5c f4 e6 fd 0f b6 1d 3d a6 a4 06 31 ff 89 RSP: 0018:ffff88809689f550 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff815e4336 RDI: ffffed1012d13e9c RBP: ffff88809689f560 R08: ffff88809c50a3c0 R09: fffffbfff15d31b1 R10: fffffbfff15d31b0 R11: ffffffff8ae98d87 R12: 0000000000000001 R13: 0000000000040100 R14: ffff888099041104 R15: ffff888218d96e40 refcount_add include/linux/refcount.h:193 [inline] skb_set_owner_w+0x2b6/0x410 net/core/sock.c:1999 sock_wmalloc+0xf1/0x120 net/core/sock.c:2096 ip_append_page+0x7ef/0x1190 net/ipv4/ip_output.c:1383 udp_sendpage+0x1c7/0x480 net/ipv4/udp.c:1276 inet_sendpage+0xdb/0x150 net/ipv4/af_inet.c:821 kernel_sendpage+0x92/0xf0 net/socket.c:3794 sock_sendpage+0x8b/0xc0 net/socket.c:936 pipe_to_sendpage+0x2da/0x3c0 fs/splice.c:458 splice_from_pipe_feed fs/splice.c:512 [inline] __splice_from_pipe+0x3ee/0x7c0 fs/splice.c:636 splice_from_pipe+0x108/0x170 fs/splice.c:671 generic_splice_sendpage+0x3c/0x50 fs/splice.c:842 do_splice_from fs/splice.c:861 [inline] direct_splice_actor+0x123/0x190 fs/splice.c:1035 splice_direct_to_actor+0x3b4/0xa30 fs/splice.c:990 do_splice_direct+0x1da/0x2a0 fs/splice.c:1078 do_sendfile+0x597/0xd00 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x1dd/0x220 fs/read_write.c:1511 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x441409 Code: e8 ac e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fffb64c4f78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441409 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000005 RBP: 0000000000073b8a R08: 0000000000000010 R09: 0000000000000010 R10: 0000000000010001 R11: 0000000000000246 R12: 0000000000402180 R13: 0000000000402210 R14: 0000000000000000 R15: 0000000000000000 Kernel Offset: disabled Rebooting in 86400 seconds.. Fixes: 1470ddf7f8ce ("inet: Remove explicit write references to sk/inet in ip_append_data") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman include/linux/netdevice.h | 5 +++++ include/net/ip.h | 5 +++++ net/core/dev.c | 3 ++- net/ipv4/devinet.c | 5 ----- net/ipv4/ip_output.c | 14 +++++++++----- 5 files changed, 21 insertions(+), 11 deletions(-) culprit signature: 0f08ddf155689a45f640d2d9852fcfb7c0e74905 parent signature: b0c01df4f9416a2213f7e8b121f7cb2a42490454 revisions tested: 11, total time: 2h34m6.339126555s (build: 1h30m0.16776089s, test: 1h2m28.122991217s) first good commit: 7272e8e3bfa354a4f2c829a80180f01dc66d4861 inet: protect against too small mtu values. cc: ["davem@davemloft.net" "edumazet@google.com" "gregkh@linuxfoundation.org"]