netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* memory leak in inet_create (2)
@ 2020-04-27 13:48 syzbot
  2020-11-23 17:31 ` syzbot
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2020-04-27 13:48 UTC (permalink / raw)
  To: andriin, ast, bpf, daniel, davem, john.fastabend, kafai, kpsingh,
	kuba, kuznet, linux-kernel, netdev, songliubraving,
	syzkaller-bugs, yhs, yoshfuji

Hello,

syzbot found the following crash on:

HEAD commit:    5ef58e29 Merge tag 'scsi-fixes' of git://git.kernel.org/pu..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10f0f144100000
kernel config:  https://syzkaller.appspot.com/x/.config?x=bb30a3887988ffff
dashboard link: https://syzkaller.appspot.com/bug?extid=bb7ba8dd62c3cb6e3c78
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=110e8fcfe00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+bb7ba8dd62c3cb6e3c78@syzkaller.appspotmail.com

2020/04/25 22:35:25 executed programs: 3
2020/04/25 22:35:30 executed programs: 5
2020/04/25 22:35:36 executed programs: 7
BUG: memory leak
unreferenced object 0xffff88811094b300 (size 2200):
  comm "syz-executor.0", pid 6864, jiffies 4294947266 (age 13.790s)
  hex dump (first 32 bytes):
    ac 14 14 bb ac 14 14 0a 89 26 f2 70 40 01 00 00  .........&.p@...
    02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............
  backtrace:
    [<000000002efa2559>] sk_prot_alloc+0x3c/0x170 net/core/sock.c:1598
    [<00000000a5b6b437>] sk_alloc+0x30/0x330 net/core/sock.c:1658
    [<00000000494c18b6>] inet_create net/ipv4/af_inet.c:321 [inline]
    [<00000000494c18b6>] inet_create+0x119/0x450 net/ipv4/af_inet.c:247
    [<000000001239bbdb>] __sock_create+0x14a/0x220 net/socket.c:1433
    [<00000000c1f7caa8>] sock_create net/socket.c:1484 [inline]
    [<00000000c1f7caa8>] __sys_socket+0x60/0x110 net/socket.c:1526
    [<00000000d35154cc>] __do_sys_socket net/socket.c:1535 [inline]
    [<00000000d35154cc>] __se_sys_socket net/socket.c:1533 [inline]
    [<00000000d35154cc>] __x64_sys_socket+0x1a/0x20 net/socket.c:1533
    [<00000000283ef9ec>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
    [<000000004290d57b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811b253f60 (size 32):
  comm "syz-executor.0", pid 6864, jiffies 4294947266 (age 13.790s)
  hex dump (first 32 bytes):
    02 00 00 00 00 00 00 00 c0 3d 3f 15 81 88 ff ff  .........=?.....
    01 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000007d627037>] kmalloc include/linux/slab.h:555 [inline]
    [<000000007d627037>] kzalloc include/linux/slab.h:669 [inline]
    [<000000007d627037>] selinux_sk_alloc_security+0x43/0xa0 security/selinux/hooks.c:5126
    [<0000000076a22383>] security_sk_alloc+0x42/0x70 security/security.c:2120
    [<0000000066acd291>] sk_prot_alloc+0x9c/0x170 net/core/sock.c:1607
    [<00000000a5b6b437>] sk_alloc+0x30/0x330 net/core/sock.c:1658
    [<00000000494c18b6>] inet_create net/ipv4/af_inet.c:321 [inline]
    [<00000000494c18b6>] inet_create+0x119/0x450 net/ipv4/af_inet.c:247
    [<000000001239bbdb>] __sock_create+0x14a/0x220 net/socket.c:1433
    [<00000000c1f7caa8>] sock_create net/socket.c:1484 [inline]
    [<00000000c1f7caa8>] __sys_socket+0x60/0x110 net/socket.c:1526
    [<00000000d35154cc>] __do_sys_socket net/socket.c:1535 [inline]
    [<00000000d35154cc>] __se_sys_socket net/socket.c:1533 [inline]
    [<00000000d35154cc>] __x64_sys_socket+0x1a/0x20 net/socket.c:1533
    [<00000000283ef9ec>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
    [<000000004290d57b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881153f3dc0 (size 64):
  comm "syz-executor.0", pid 6864, jiffies 4294947266 (age 13.790s)
  hex dump (first 32 bytes):
    15 00 00 01 00 00 00 00 20 68 e9 1c 81 88 ff ff  ........ h......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000dde82831>] kmalloc include/linux/slab.h:555 [inline]
    [<00000000dde82831>] kzalloc include/linux/slab.h:669 [inline]
    [<00000000dde82831>] netlbl_secattr_alloc include/net/netlabel.h:382 [inline]
    [<00000000dde82831>] selinux_netlbl_sock_genattr+0x48/0x180 security/selinux/netlabel.c:76
    [<00000000438c6346>] selinux_netlbl_socket_post_create+0x41/0xb0 security/selinux/netlabel.c:398
    [<00000000b422abf2>] selinux_socket_post_create+0x182/0x390 security/selinux/hooks.c:4541
    [<000000005be0d1ac>] security_socket_post_create+0x54/0x80 security/security.c:2032
    [<00000000a0ec3d71>] __sock_create+0x1cc/0x220 net/socket.c:1449
    [<00000000c1f7caa8>] sock_create net/socket.c:1484 [inline]
    [<00000000c1f7caa8>] __sys_socket+0x60/0x110 net/socket.c:1526
    [<00000000d35154cc>] __do_sys_socket net/socket.c:1535 [inline]
    [<00000000d35154cc>] __se_sys_socket net/socket.c:1533 [inline]
    [<00000000d35154cc>] __x64_sys_socket+0x1a/0x20 net/socket.c:1533
    [<00000000283ef9ec>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
    [<000000004290d57b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88811ce96820 (size 32):
  comm "syz-executor.0", pid 6864, jiffies 4294947266 (age 13.790s)
  hex dump (first 32 bytes):
    6b 65 72 6e 65 6c 5f 74 00 73 79 73 74 65 6d 5f  kernel_t.system_
    72 3a 6b 65 72 6e 65 6c 5f 74 3a 73 30 00 00 00  r:kernel_t:s0...
  backtrace:
    [<000000007edbec14>] kstrdup+0x36/0x70 mm/util.c:60
    [<00000000b343d2c4>] security_netlbl_sid_to_secattr+0x97/0x100 security/selinux/ss/services.c:3739
    [<00000000ddb8495a>] selinux_netlbl_sock_genattr+0x67/0x180 security/selinux/netlabel.c:79
    [<00000000438c6346>] selinux_netlbl_socket_post_create+0x41/0xb0 security/selinux/netlabel.c:398
    [<00000000b422abf2>] selinux_socket_post_create+0x182/0x390 security/selinux/hooks.c:4541
    [<000000005be0d1ac>] security_socket_post_create+0x54/0x80 security/security.c:2032
    [<00000000a0ec3d71>] __sock_create+0x1cc/0x220 net/socket.c:1449
    [<00000000c1f7caa8>] sock_create net/socket.c:1484 [inline]
    [<00000000c1f7caa8>] __sys_socket+0x60/0x110 net/socket.c:1526
    [<00000000d35154cc>] __do_sys_socket net/socket.c:1535 [inline]
    [<00000000d35154cc>] __se_sys_socket net/socket.c:1533 [inline]
    [<00000000d35154cc>] __x64_sys_socket+0x1a/0x20 net/socket.c:1533
    [<00000000283ef9ec>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
    [<000000004290d57b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff8881113aa400 (size 512):
  comm "syz-executor.0", pid 6864, jiffies 4294947266 (age 13.790s)
  hex dump (first 32 bytes):
    00 b3 94 10 81 88 ff ff 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000031227790>] kmalloc_node include/linux/slab.h:573 [inline]
    [<0000000031227790>] kzalloc_node include/linux/slab.h:680 [inline]
    [<0000000031227790>] sk_psock_init+0x2a/0x180 net/core/skmsg.c:496
    [<00000000a405c065>] sock_map_link.isra.0+0x469/0x4f0 net/core/sock_map.c:236
    [<000000003b7d5922>] sock_map_update_common+0xa1/0x3c0 net/core/sock_map.c:451
    [<00000000f12c515e>] sock_map_update_elem+0x1e9/0x220 net/core/sock_map.c:552
    [<000000000fedde3d>] bpf_map_update_value.isra.0+0x141/0x2f0 kernel/bpf/syscall.c:169
    [<000000004deb6133>] map_update_elem kernel/bpf/syscall.c:1098 [inline]
    [<000000004deb6133>] __do_sys_bpf+0x16bf/0x1f00 kernel/bpf/syscall.c:3689
    [<00000000283ef9ec>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
    [<000000004290d57b>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: memory leak in inet_create (2)
  2020-04-27 13:48 memory leak in inet_create (2) syzbot
@ 2020-11-23 17:31 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2020-11-23 17:31 UTC (permalink / raw)
  To: andrii, andriin, ast, bpf, daniel, davem, john.fastabend, kafai,
	kpsingh, kuba, kuznet, linux-kernel, netdev, songliubraving,
	syzkaller-bugs, yhs, yoshfuji

syzbot has found a reproducer for the following issue on:

HEAD commit:    418baf2c Linux 5.10-rc5
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=161c84ed500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5524c10373633a9c
dashboard link: https://syzkaller.appspot.com/bug?extid=bb7ba8dd62c3cb6e3c78
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1514cfa3500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11a52fc1500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+bb7ba8dd62c3cb6e3c78@syzkaller.appspotmail.com

executing program
executing program
executing program
BUG: memory leak
unreferenced object 0xffff88810e85adc0 (size 1728):
  comm "syz-executor376", pid 8506, jiffies 4294946899 (age 13.430s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............
  backtrace:
    [<00000000cb2829d9>] sk_prot_alloc+0x3e/0x1c0 net/core/sock.c:1660
    [<0000000023bd8ef8>] sk_alloc+0x30/0x3f0 net/core/sock.c:1720
    [<00000000a4a7ed0a>] inet_create net/ipv4/af_inet.c:322 [inline]
    [<00000000a4a7ed0a>] inet_create+0x16a/0x560 net/ipv4/af_inet.c:248
    [<000000003b729101>] __sock_create+0x1ab/0x2b0 net/socket.c:1427
    [<00000000ebee6fd5>] sock_create net/socket.c:1478 [inline]
    [<00000000ebee6fd5>] __sys_socket+0x6f/0x140 net/socket.c:1520
    [<00000000bcf20e68>] __do_sys_socket net/socket.c:1529 [inline]
    [<00000000bcf20e68>] __se_sys_socket net/socket.c:1527 [inline]
    [<00000000bcf20e68>] __x64_sys_socket+0x1a/0x20 net/socket.c:1527
    [<00000000732fe45a>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<0000000091e76b15>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fec3c80 (size 768):
  comm "syz-executor376", pid 8506, jiffies 4294946899 (age 13.430s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 c0 72 a0 0e 81 88 ff ff  .........r......
  backtrace:
    [<00000000681cd6ae>] sock_alloc_inode+0x18/0x90 net/socket.c:253
    [<00000000fa9d2004>] alloc_inode+0x27/0x100 fs/inode.c:234
    [<00000000f3a018c7>] new_inode_pseudo+0x13/0x70 fs/inode.c:930
    [<00000000549f715a>] sock_alloc+0x18/0x90 net/socket.c:573
    [<00000000a044e0d4>] __sock_create+0xb8/0x2b0 net/socket.c:1391
    [<00000000973ca39c>] mptcp_subflow_create_socket+0x57/0x280 net/mptcp/subflow.c:1152
    [<00000000a3724864>] __mptcp_socket_create net/mptcp/protocol.c:97 [inline]
    [<00000000a3724864>] mptcp_init_sock net/mptcp/protocol.c:1859 [inline]
    [<00000000a3724864>] mptcp_init_sock+0x12f/0x270 net/mptcp/protocol.c:1844
    [<00000000c97baf32>] inet_create net/ipv4/af_inet.c:380 [inline]
    [<00000000c97baf32>] inet_create+0x2ed/0x560 net/ipv4/af_inet.c:248
    [<000000003b729101>] __sock_create+0x1ab/0x2b0 net/socket.c:1427
    [<00000000ebee6fd5>] sock_create net/socket.c:1478 [inline]
    [<00000000ebee6fd5>] __sys_socket+0x6f/0x140 net/socket.c:1520
    [<00000000bcf20e68>] __do_sys_socket net/socket.c:1529 [inline]
    [<00000000bcf20e68>] __se_sys_socket net/socket.c:1527 [inline]
    [<00000000bcf20e68>] __x64_sys_socket+0x1a/0x20 net/socket.c:1527
    [<00000000732fe45a>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<0000000091e76b15>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810de87bb8 (size 24):
  comm "syz-executor376", pid 8506, jiffies 4294946899 (age 13.430s)
  hex dump (first 24 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00                          ........
  backtrace:
    [<00000000bea9ec8c>] kmem_cache_zalloc include/linux/slab.h:654 [inline]
    [<00000000bea9ec8c>] lsm_inode_alloc security/security.c:589 [inline]
    [<00000000bea9ec8c>] security_inode_alloc+0x2a/0xb0 security/security.c:972
    [<00000000543365c5>] inode_init_always+0x10c/0x250 fs/inode.c:171
    [<000000004da5c777>] alloc_inode+0x44/0x100 fs/inode.c:241
    [<00000000f3a018c7>] new_inode_pseudo+0x13/0x70 fs/inode.c:930
    [<00000000549f715a>] sock_alloc+0x18/0x90 net/socket.c:573
    [<00000000a044e0d4>] __sock_create+0xb8/0x2b0 net/socket.c:1391
    [<00000000973ca39c>] mptcp_subflow_create_socket+0x57/0x280 net/mptcp/subflow.c:1152
    [<00000000a3724864>] __mptcp_socket_create net/mptcp/protocol.c:97 [inline]
    [<00000000a3724864>] mptcp_init_sock net/mptcp/protocol.c:1859 [inline]
    [<00000000a3724864>] mptcp_init_sock+0x12f/0x270 net/mptcp/protocol.c:1844
    [<00000000c97baf32>] inet_create net/ipv4/af_inet.c:380 [inline]
    [<00000000c97baf32>] inet_create+0x2ed/0x560 net/ipv4/af_inet.c:248
    [<000000003b729101>] __sock_create+0x1ab/0x2b0 net/socket.c:1427
    [<00000000ebee6fd5>] sock_create net/socket.c:1478 [inline]
    [<00000000ebee6fd5>] __sys_socket+0x6f/0x140 net/socket.c:1520
    [<00000000bcf20e68>] __do_sys_socket net/socket.c:1529 [inline]
    [<00000000bcf20e68>] __se_sys_socket net/socket.c:1527 [inline]
    [<00000000bcf20e68>] __x64_sys_socket+0x1a/0x20 net/socket.c:1527
    [<00000000732fe45a>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<0000000091e76b15>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810ea072c0 (size 2208):
  comm "syz-executor376", pid 8506, jiffies 4294946899 (age 13.430s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    02 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00  ...@............
  backtrace:
    [<00000000cb2829d9>] sk_prot_alloc+0x3e/0x1c0 net/core/sock.c:1660
    [<0000000023bd8ef8>] sk_alloc+0x30/0x3f0 net/core/sock.c:1720
    [<00000000a4a7ed0a>] inet_create net/ipv4/af_inet.c:322 [inline]
    [<00000000a4a7ed0a>] inet_create+0x16a/0x560 net/ipv4/af_inet.c:248
    [<000000003b729101>] __sock_create+0x1ab/0x2b0 net/socket.c:1427
    [<00000000973ca39c>] mptcp_subflow_create_socket+0x57/0x280 net/mptcp/subflow.c:1152
    [<00000000a3724864>] __mptcp_socket_create net/mptcp/protocol.c:97 [inline]
    [<00000000a3724864>] mptcp_init_sock net/mptcp/protocol.c:1859 [inline]
    [<00000000a3724864>] mptcp_init_sock+0x12f/0x270 net/mptcp/protocol.c:1844
    [<00000000c97baf32>] inet_create net/ipv4/af_inet.c:380 [inline]
    [<00000000c97baf32>] inet_create+0x2ed/0x560 net/ipv4/af_inet.c:248
    [<000000003b729101>] __sock_create+0x1ab/0x2b0 net/socket.c:1427
    [<00000000ebee6fd5>] sock_create net/socket.c:1478 [inline]
    [<00000000ebee6fd5>] __sys_socket+0x6f/0x140 net/socket.c:1520
    [<00000000bcf20e68>] __do_sys_socket net/socket.c:1529 [inline]
    [<00000000bcf20e68>] __se_sys_socket net/socket.c:1527 [inline]
    [<00000000bcf20e68>] __x64_sys_socket+0x1a/0x20 net/socket.c:1527
    [<00000000732fe45a>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
    [<0000000091e76b15>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-23 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 13:48 memory leak in inet_create (2) syzbot
2020-11-23 17:31 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).