[syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast

8 views
Skip to first unread message

syzbot

unread,
Dec 16, 2025, 5:06:37 AM (yesterday) Dec 16
to andrew...@lunn.ch, da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, linu...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, pet...@nucleusys.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d358e5254674 Merge tag 'for-6.19/dm-changes' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11e431c2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=9a0268003e02068d
dashboard link: https://syzkaller.appspot.com/bug?extid=8dd915c7cb0490fc8c52
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12dd661a580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e79f317bb571/disk-d358e525.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cf9e2849af10/vmlinux-d358e525.xz
kernel image: https://storage.googleapis.com/syzbot-assets/73d80a967038/bzImage-d358e525.xz

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

BUG: memory leak
unreferenced object 0xffff888127d51010 (size 16):
comm "dhcpcd", pid 5479, jiffies 4294951443
hex dump (first 16 bytes):
40 05 30 01 00 00 02 00 9e 00 00 00 00 00 00 00 @.0.............
backtrace (crc 5546a3be):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__kmalloc_cache_noprof+0x3b2/0x570 mm/slub.c:5771
kmalloc_noprof include/linux/slab.h:957 [inline]
async_set_registers drivers/net/usb/rtl8150.c:192 [inline]
rtl8150_set_multicast+0x7a/0x1c0 drivers/net/usb/rtl8150.c:679
__dev_set_rx_mode+0xc5/0x120 net/core/dev.c:9655
dev_set_rx_mode net/core/dev.c:9661 [inline]
__dev_open+0x23f/0x3c0 net/core/dev.c:1691
__dev_change_flags+0x30c/0x380 net/core/dev.c:9734
netif_change_flags+0x35/0x90 net/core/dev.c:9797
dev_change_flags+0x64/0xf0 net/core/dev_api.c:68
devinet_ioctl+0x5bf/0xd30 net/ipv4/devinet.c:1199
inet_ioctl+0x27c/0x2b0 net/ipv4/af_inet.c:1009
sock_do_ioctl+0x84/0x1a0 net/socket.c:1254
sock_ioctl+0x149/0x480 net/socket.c:1375
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff8881282bae40 (size 192):
comm "dhcpcd", pid 5479, jiffies 4294951443
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 58 ae 2b 28 81 88 ff ff ........X.+(....
backtrace (crc d110b1b3):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
__do_kmalloc_node mm/slub.c:5656 [inline]
__kmalloc_noprof+0x3e0/0x660 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
usb_alloc_urb+0x66/0xa0 drivers/usb/core/urb.c:75
async_set_registers drivers/net/usb/rtl8150.c:195 [inline]
rtl8150_set_multicast+0x97/0x1c0 drivers/net/usb/rtl8150.c:679
__dev_set_rx_mode+0xc5/0x120 net/core/dev.c:9655
dev_set_rx_mode net/core/dev.c:9661 [inline]
__dev_open+0x23f/0x3c0 net/core/dev.c:1691
__dev_change_flags+0x30c/0x380 net/core/dev.c:9734
netif_change_flags+0x35/0x90 net/core/dev.c:9797
dev_change_flags+0x64/0xf0 net/core/dev_api.c:68
devinet_ioctl+0x5bf/0xd30 net/ipv4/devinet.c:1199
inet_ioctl+0x27c/0x2b0 net/ipv4/af_inet.c:1009
sock_do_ioctl+0x84/0x1a0 net/socket.c:1254
sock_ioctl+0x149/0x480 net/socket.c:1375
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Dec 16, 2025, 6:37:32 PM (16 hours ago) Dec 16
to rakag...@gmail.com, rakag...@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

I've failed to parse your command.
Did you perhaps forget to provide the branch name, or added an extra ':'?
Please use one of the two supported formats:
1. #syz test
2. #syz test: repo branch-or-commit-hash
Note the lack of ':' in option 1.

> master
>
> async_set_registers() does not free the urb and req on the
> usb_submit_urb() call fail path. Fix by freeing both objects.
>
> Reported-by: syzbot+8dd915...@syzkaller.appspotmail.com
> Signed-off-by: Raka Gunarto <rakag...@gmail.com>
> ---
> drivers/net/usb/rtl8150.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
> index 278e6cb6f4..0f6c700a85 100644
> --- a/drivers/net/usb/rtl8150.c
> +++ b/drivers/net/usb/rtl8150.c
> @@ -211,6 +211,8 @@ static int async_set_registers(rtl8150_t *dev, u16
> indx, u16 size, u16 reg)
> if (res == -ENODEV)
> netif_device_detach(dev->netdev);
> dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res);
> + usb_free_urb(async_urb);
> + kfree(req);
> }
> return res;
> }
> --

syzbot

unread,
Dec 16, 2025, 6:42:34 PM (16 hours ago) Dec 16
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
Author: rakag...@gmail.com

#syz test

async_set_registers() does not free the urb and req on the
usb_submit_urb() call fail path. Fix by freeing both objects.

Reported-by: syzbot+8dd915...@syzkaller.appspotmail.com
Signed-off-by: Raka Gunarto <rakag...@gmail.com>
---
drivers/net/usb/rtl8150.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 278e6cb6f4..0f6c700a85 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -211,6 +211,8 @@ static int async_set_registers(rtl8150_t *dev, u16
indx, u16 size, u16 reg)
if (res == -ENODEV)
netif_device_detach(dev->netdev);
dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res);
+ usb_free_urb(async_urb);
+ kfree(req);
}
return res;
}
--
2.25.1

On Tue, Dec 16, 2025 at 11:23 PM Raka Gunarto <rakag...@gmail.com> wrote:
>
> async_set_registers() does not free the urb and req on the
> usb_submit_urb() call fail path. Fix by freeing both objects.
>
> Reported-by: syzbot+8dd915...@syzkaller.appspotmail.com
> Signed-off-by: Raka Gunarto <rakag...@gmail.com>
> ---
> drivers/net/usb/rtl8150.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
> index 278e6cb6f4..0f6c700a85 100644
> --- a/drivers/net/usb/rtl8150.c
> +++ b/drivers/net/usb/rtl8150.c
> @@ -211,6 +211,8 @@ static int async_set_registers(rtl8150_t *dev, u16
> indx, u16 size, u16 reg)
> if (res == -ENODEV)
> netif_device_detach(dev->netdev);
> dev_err(&dev->udev->dev, "%s failed with %d\n", __func__, res);
> + usb_free_urb(async_urb);
> + kfree(req);
> }
> return res;
> }
> --
> 2.25.1

syzbot

unread,
Dec 16, 2025, 6:48:05 PM (16 hours ago) Dec 16
to linux-...@vger.kernel.org, rakag...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file drivers/net/usb/rtl8150.c
patch: **** unexpected end of file in patch



Tested on:

commit: 40fbbd64 Merge tag 'pull-fixes' of git://git.kernel.or..
git tree: upstream
patch: https://syzkaller.appspot.com/x/patch.diff?x=1013931a580000

Raka Gunarto

unread,
Dec 16, 2025, 7:28:26 PM (15 hours ago) Dec 16
to syzbot, andrew...@lunn.ch, da...@davemloft.net, edum...@google.com, ku...@kernel.org, Linux Kernel Mailing List, linu...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, pet...@nucleusys.com, syzkall...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages