[syzbot] memory leak in j1939_xtp_rx_rts

21 views
Skip to first unread message

syzbot

unread,
Jun 22, 2021, 1:24:25 PM6/22/21
to da...@davemloft.net, ker...@pengutronix.de, ku...@kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, li...@rempel-privat.de, m...@pengutronix.de, net...@vger.kernel.org, ro...@protonic.nl, sock...@hartkopp.net, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: fd0aa1a4 Merge tag 'for-linus' of git://git.kernel.org/pub..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=155c8d10300000
kernel config: https://syzkaller.appspot.com/x/.config?x=6ec2526c74098317
dashboard link: https://syzkaller.appspot.com/bug?extid=d56eaa979f1a3d6e2e2e
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=110912a4300000

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

BUG: memory leak
unreferenced object 0xffff888126b3d500 (size 232):
comm "softirq", pid 0, jiffies 4294974634 (age 13.120s)
hex dump (first 32 bytes):
68 16 14 26 81 88 ff ff 68 16 14 26 81 88 ff ff h..&....h..&....
00 80 5d 22 81 88 ff ff 00 00 00 00 00 00 00 00 ..]"............
backtrace:
[<ffffffff836a0d5f>] __alloc_skb+0x20f/0x280 net/core/skbuff.c:413
[<ffffffff83c599e1>] alloc_skb include/linux/skbuff.h:1107 [inline]
[<ffffffff83c599e1>] j1939_session_fresh_new net/can/j1939/transport.c:1484 [inline]
[<ffffffff83c599e1>] j1939_xtp_rx_rts_session_new net/can/j1939/transport.c:1578 [inline]
[<ffffffff83c599e1>] j1939_xtp_rx_rts+0x451/0xac0 net/can/j1939/transport.c:1679
[<ffffffff83c5a7eb>] j1939_tp_cmd_recv net/can/j1939/transport.c:1986 [inline]
[<ffffffff83c5a7eb>] j1939_tp_recv+0x44b/0x640 net/can/j1939/transport.c:2067
[<ffffffff83c515dc>] j1939_can_recv+0x2bc/0x420 net/can/j1939/main.c:101
[<ffffffff83c43d98>] deliver net/can/af_can.c:574 [inline]
[<ffffffff83c43d98>] can_rcv_filter+0xd8/0x290 net/can/af_can.c:608
[<ffffffff83c44360>] can_receive+0xf0/0x140 net/can/af_can.c:665
[<ffffffff83c4442d>] can_rcv+0x7d/0xf0 net/can/af_can.c:696
[<ffffffff836d2e1a>] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5459
[<ffffffff836d2ea7>] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5573
[<ffffffff836d3234>] process_backlog+0xb4/0x1a0 net/core/dev.c:6437
[<ffffffff836d54fd>] __napi_poll+0x3d/0x2a0 net/core/dev.c:6985
[<ffffffff836d5cea>] napi_poll net/core/dev.c:7052 [inline]
[<ffffffff836d5cea>] net_rx_action+0x32a/0x410 net/core/dev.c:7139
[<ffffffff846000bf>] __do_softirq+0xbf/0x2ab kernel/softirq.c:559
[<ffffffff81238a0c>] do_softirq kernel/softirq.c:460 [inline]
[<ffffffff81238a0c>] do_softirq+0x5c/0x80 kernel/softirq.c:447
[<ffffffff81238a81>] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:384
[<ffffffff840bf0cd>] spin_unlock_bh include/linux/spinlock.h:399 [inline]
[<ffffffff840bf0cd>] batadv_nc_purge_paths+0x19d/0x1f0 net/batman-adv/network-coding.c:467

BUG: memory leak
unreferenced object 0xffff888126141600 (size 512):
comm "softirq", pid 0, jiffies 4294974634 (age 13.120s)
hex dump (first 32 bytes):
00 e0 9f 2a 81 88 ff ff 08 16 14 26 81 88 ff ff ...*.......&....
08 16 14 26 81 88 ff ff 18 16 14 26 81 88 ff ff ...&.......&....
backtrace:
[<ffffffff83c552eb>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff83c552eb>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff83c552eb>] j1939_session_new+0x5b/0x160 net/can/j1939/transport.c:1443
[<ffffffff83c59a78>] j1939_session_fresh_new net/can/j1939/transport.c:1495 [inline]
[<ffffffff83c59a78>] j1939_xtp_rx_rts_session_new net/can/j1939/transport.c:1578 [inline]
[<ffffffff83c59a78>] j1939_xtp_rx_rts+0x4e8/0xac0 net/can/j1939/transport.c:1679
[<ffffffff83c5a7eb>] j1939_tp_cmd_recv net/can/j1939/transport.c:1986 [inline]
[<ffffffff83c5a7eb>] j1939_tp_recv+0x44b/0x640 net/can/j1939/transport.c:2067
[<ffffffff83c515dc>] j1939_can_recv+0x2bc/0x420 net/can/j1939/main.c:101
[<ffffffff83c43d98>] deliver net/can/af_can.c:574 [inline]
[<ffffffff83c43d98>] can_rcv_filter+0xd8/0x290 net/can/af_can.c:608
[<ffffffff83c44360>] can_receive+0xf0/0x140 net/can/af_can.c:665
[<ffffffff83c4442d>] can_rcv+0x7d/0xf0 net/can/af_can.c:696
[<ffffffff836d2e1a>] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5459
[<ffffffff836d2ea7>] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5573
[<ffffffff836d3234>] process_backlog+0xb4/0x1a0 net/core/dev.c:6437
[<ffffffff836d54fd>] __napi_poll+0x3d/0x2a0 net/core/dev.c:6985
[<ffffffff836d5cea>] napi_poll net/core/dev.c:7052 [inline]
[<ffffffff836d5cea>] net_rx_action+0x32a/0x410 net/core/dev.c:7139
[<ffffffff846000bf>] __do_softirq+0xbf/0x2ab kernel/softirq.c:559
[<ffffffff81238a0c>] do_softirq kernel/softirq.c:460 [inline]
[<ffffffff81238a0c>] do_softirq+0x5c/0x80 kernel/softirq.c:447
[<ffffffff81238a81>] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:384
[<ffffffff840bf0cd>] spin_unlock_bh include/linux/spinlock.h:399 [inline]
[<ffffffff840bf0cd>] batadv_nc_purge_paths+0x19d/0x1f0 net/batman-adv/network-coding.c:467

BUG: memory leak
unreferenced object 0xffff888126b3d300 (size 232):
comm "softirq", pid 0, jiffies 4294974634 (age 13.120s)
hex dump (first 32 bytes):
68 08 05 27 81 88 ff ff 68 08 05 27 81 88 ff ff h..'....h..'....
00 00 0b 22 81 88 ff ff 00 00 00 00 00 00 00 00 ..."............
backtrace:
[<ffffffff836a0d5f>] __alloc_skb+0x20f/0x280 net/core/skbuff.c:413
[<ffffffff83c599e1>] alloc_skb include/linux/skbuff.h:1107 [inline]
[<ffffffff83c599e1>] j1939_session_fresh_new net/can/j1939/transport.c:1484 [inline]
[<ffffffff83c599e1>] j1939_xtp_rx_rts_session_new net/can/j1939/transport.c:1578 [inline]
[<ffffffff83c599e1>] j1939_xtp_rx_rts+0x451/0xac0 net/can/j1939/transport.c:1679
[<ffffffff83c5a7eb>] j1939_tp_cmd_recv net/can/j1939/transport.c:1986 [inline]
[<ffffffff83c5a7eb>] j1939_tp_recv+0x44b/0x640 net/can/j1939/transport.c:2067
[<ffffffff83c515dc>] j1939_can_recv+0x2bc/0x420 net/can/j1939/main.c:101
[<ffffffff83c43d98>] deliver net/can/af_can.c:574 [inline]
[<ffffffff83c43d98>] can_rcv_filter+0xd8/0x290 net/can/af_can.c:608
[<ffffffff83c44360>] can_receive+0xf0/0x140 net/can/af_can.c:665
[<ffffffff83c4442d>] can_rcv+0x7d/0xf0 net/can/af_can.c:696
[<ffffffff836d2e1a>] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5459
[<ffffffff836d2ea7>] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5573
[<ffffffff836d3234>] process_backlog+0xb4/0x1a0 net/core/dev.c:6437
[<ffffffff836d54fd>] __napi_poll+0x3d/0x2a0 net/core/dev.c:6985
[<ffffffff836d5cea>] napi_poll net/core/dev.c:7052 [inline]
[<ffffffff836d5cea>] net_rx_action+0x32a/0x410 net/core/dev.c:7139
[<ffffffff846000bf>] __do_softirq+0xbf/0x2ab kernel/softirq.c:559
[<ffffffff81238a0c>] do_softirq kernel/softirq.c:460 [inline]
[<ffffffff81238a0c>] do_softirq+0x5c/0x80 kernel/softirq.c:447
[<ffffffff81238a81>] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:384
[<ffffffff840bf0cd>] spin_unlock_bh include/linux/spinlock.h:399 [inline]
[<ffffffff840bf0cd>] batadv_nc_purge_paths+0x19d/0x1f0 net/batman-adv/network-coding.c:467



---
This report 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 syzk...@googlegroups.com.

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

syzbot

unread,
Jun 25, 2021, 5:53:09 AM6/25/21
to phin...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
memory leak in j1939_sk_sendmsg

BUG: memory leak
unreferenced object 0xffff888113967400 (size 232):
comm "syz-executor.6", pid 10594, jiffies 4294944574 (age 13.620s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 82 10 81 88 ff ff 00 20 60 28 81 88 ff ff ......... `(....
backtrace:
[<ffffffff836da3df>] __alloc_skb+0x20f/0x280 net/core/skbuff.c:414
[<ffffffff836e4c1a>] alloc_skb include/linux/skbuff.h:1112 [inline]
[<ffffffff836e4c1a>] alloc_skb_with_frags+0x6a/0x2b0 net/core/skbuff.c:6004
[<ffffffff836d2773>] sock_alloc_send_pskb+0x353/0x3c0 net/core/sock.c:2377
[<ffffffff83c94a5f>] j1939_sk_alloc_skb net/can/j1939/socket.c:861 [inline]
[<ffffffff83c94a5f>] j1939_sk_send_loop net/can/j1939/socket.c:1043 [inline]
[<ffffffff83c94a5f>] j1939_sk_sendmsg+0x2cf/0x800 net/can/j1939/socket.c:1178
[<ffffffff836c93e6>] sock_sendmsg_nosec net/socket.c:702 [inline]
[<ffffffff836c93e6>] sock_sendmsg+0x56/0x80 net/socket.c:722
[<ffffffff836cf7af>] sock_no_sendpage+0x8f/0xc0 net/core/sock.c:2875
[<ffffffff836c8cb3>] kernel_sendpage.part.0+0xa3/0x140 net/socket.c:3666
[<ffffffff836c99cb>] kernel_sendpage net/socket.c:3663 [inline]
[<ffffffff836c99cb>] sock_sendpage+0x5b/0x90 net/socket.c:995
[<ffffffff815c6af2>] pipe_to_sendpage+0xa2/0x110 fs/splice.c:364
[<ffffffff815c8992>] splice_from_pipe_feed fs/splice.c:418 [inline]
[<ffffffff815c8992>] __splice_from_pipe+0x1e2/0x330 fs/splice.c:562
[<ffffffff815c91bf>] splice_from_pipe fs/splice.c:597 [inline]
[<ffffffff815c91bf>] generic_splice_sendpage+0x6f/0xa0 fs/splice.c:746
[<ffffffff815c6bab>] do_splice_from fs/splice.c:767 [inline]
[<ffffffff815c6bab>] direct_splice_actor+0x4b/0x70 fs/splice.c:936
[<ffffffff815c72c3>] splice_direct_to_actor+0x153/0x350 fs/splice.c:891
[<ffffffff815c75a8>] do_splice_direct+0xe8/0x150 fs/splice.c:979
[<ffffffff815680af>] do_sendfile+0x51f/0x760 fs/read_write.c:1260
[<ffffffff8156a9e2>] __do_sys_sendfile64 fs/read_write.c:1325 [inline]
[<ffffffff8156a9e2>] __se_sys_sendfile64 fs/read_write.c:1311 [inline]
[<ffffffff8156a9e2>] __x64_sys_sendfile64+0xe2/0x100 fs/read_write.c:1311

BUG: memory leak
unreferenced object 0xffff888113967900 (size 232):
comm "syz-executor.6", pid 10594, jiffies 4294944575 (age 13.610s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 82 10 81 88 ff ff 00 20 60 28 81 88 ff ff ......... `(....
backtrace:
[<ffffffff836da3df>] __alloc_skb+0x20f/0x280 net/core/skbuff.c:414
[<ffffffff836e4c1a>] alloc_skb include/linux/skbuff.h:1112 [inline]
[<ffffffff836e4c1a>] alloc_skb_with_frags+0x6a/0x2b0 net/core/skbuff.c:6004
[<ffffffff836d2773>] sock_alloc_send_pskb+0x353/0x3c0 net/core/sock.c:2377
[<ffffffff83c94a5f>] j1939_sk_alloc_skb net/can/j1939/socket.c:861 [inline]
[<ffffffff83c94a5f>] j1939_sk_send_loop net/can/j1939/socket.c:1043 [inline]
[<ffffffff83c94a5f>] j1939_sk_sendmsg+0x2cf/0x800 net/can/j1939/socket.c:1178
[<ffffffff836c93e6>] sock_sendmsg_nosec net/socket.c:702 [inline]
[<ffffffff836c93e6>] sock_sendmsg+0x56/0x80 net/socket.c:722
[<ffffffff836cf7af>] sock_no_sendpage+0x8f/0xc0 net/core/sock.c:2875
[<ffffffff836c8cb3>] kernel_sendpage.part.0+0xa3/0x140 net/socket.c:3666
[<ffffffff836c99cb>] kernel_sendpage net/socket.c:3663 [inline]
[<ffffffff836c99cb>] sock_sendpage+0x5b/0x90 net/socket.c:995
[<ffffffff815c6af2>] pipe_to_sendpage+0xa2/0x110 fs/splice.c:364
[<ffffffff815c8992>] splice_from_pipe_feed fs/splice.c:418 [inline]
[<ffffffff815c8992>] __splice_from_pipe+0x1e2/0x330 fs/splice.c:562
[<ffffffff815c91bf>] splice_from_pipe fs/splice.c:597 [inline]
[<ffffffff815c91bf>] generic_splice_sendpage+0x6f/0xa0 fs/splice.c:746
[<ffffffff815c6bab>] do_splice_from fs/splice.c:767 [inline]
[<ffffffff815c6bab>] direct_splice_actor+0x4b/0x70 fs/splice.c:936
[<ffffffff815c72c3>] splice_direct_to_actor+0x153/0x350 fs/splice.c:891
[<ffffffff815c75a8>] do_splice_direct+0xe8/0x150 fs/splice.c:979
[<ffffffff815680af>] do_sendfile+0x51f/0x760 fs/read_write.c:1260
[<ffffffff8156a9e2>] __do_sys_sendfile64 fs/read_write.c:1325 [inline]
[<ffffffff8156a9e2>] __se_sys_sendfile64 fs/read_write.c:1311 [inline]
[<ffffffff8156a9e2>] __x64_sys_sendfile64+0xe2/0x100 fs/read_write.c:1311

BUG: memory leak
unreferenced object 0xffff888128952c00 (size 1024):
comm "syz-executor.6", pid 10594, jiffies 4294944575 (age 13.610s)
hex dump (first 32 bytes):
0e 00 00 00 00 00 00 00 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:
[<ffffffff836da2af>] kmalloc_reserve net/core/skbuff.c:355 [inline]
[<ffffffff836da2af>] __alloc_skb+0xdf/0x280 net/core/skbuff.c:426
[<ffffffff836e4c1a>] alloc_skb include/linux/skbuff.h:1112 [inline]
[<ffffffff836e4c1a>] alloc_skb_with_frags+0x6a/0x2b0 net/core/skbuff.c:6004
[<ffffffff836d2773>] sock_alloc_send_pskb+0x353/0x3c0 net/core/sock.c:2377
[<ffffffff83c94a5f>] j1939_sk_alloc_skb net/can/j1939/socket.c:861 [inline]
[<ffffffff83c94a5f>] j1939_sk_send_loop net/can/j1939/socket.c:1043 [inline]
[<ffffffff83c94a5f>] j1939_sk_sendmsg+0x2cf/0x800 net/can/j1939/socket.c:1178
[<ffffffff836c93e6>] sock_sendmsg_nosec net/socket.c:702 [inline]
[<ffffffff836c93e6>] sock_sendmsg+0x56/0x80 net/socket.c:722
[<ffffffff836cf7af>] sock_no_sendpage+0x8f/0xc0 net/core/sock.c:2875
[<ffffffff836c8cb3>] kernel_sendpage.part.0+0xa3/0x140 net/socket.c:3666
[<ffffffff836c99cb>] kernel_sendpage net/socket.c:3663 [inline]
[<ffffffff836c99cb>] sock_sendpage+0x5b/0x90 net/socket.c:995
[<ffffffff815c6af2>] pipe_to_sendpage+0xa2/0x110 fs/splice.c:364
[<ffffffff815c8992>] splice_from_pipe_feed fs/splice.c:418 [inline]
[<ffffffff815c8992>] __splice_from_pipe+0x1e2/0x330 fs/splice.c:562
[<ffffffff815c91bf>] splice_from_pipe fs/splice.c:597 [inline]
[<ffffffff815c91bf>] generic_splice_sendpage+0x6f/0xa0 fs/splice.c:746
[<ffffffff815c6bab>] do_splice_from fs/splice.c:767 [inline]
[<ffffffff815c6bab>] direct_splice_actor+0x4b/0x70 fs/splice.c:936
[<ffffffff815c72c3>] splice_direct_to_actor+0x153/0x350 fs/splice.c:891
[<ffffffff815c75a8>] do_splice_direct+0xe8/0x150 fs/splice.c:979
[<ffffffff815680af>] do_sendfile+0x51f/0x760 fs/read_write.c:1260
[<ffffffff8156a9e2>] __do_sys_sendfile64 fs/read_write.c:1325 [inline]
[<ffffffff8156a9e2>] __se_sys_sendfile64 fs/read_write.c:1311 [inline]
[<ffffffff8156a9e2>] __x64_sys_sendfile64+0xe2/0x100 fs/read_write.c:1311



Tested on:

commit: 2a8927f0 Add linux-next specific files for 20210624
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=11e2ea90300000
kernel config: https://syzkaller.appspot.com/x/.config?x=45f6a7a3f5d3951
dashboard link: https://syzkaller.appspot.com/bug?extid=d56eaa979f1a3d6e2e2e
compiler:

syzbot

unread,
Sep 8, 2023, 6:49:51 PM9/8/23
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages