public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
@ 2025-12-16 10:06 syzbot
  2025-12-16 23:23 ` Raka Gunarto
  0 siblings, 1 reply; 4+ messages in thread
From: syzbot @ 2025-12-16 10:06 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, linux-kernel, linux-usb,
	netdev, pabeni, petkan, syzkaller-bugs

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+8dd915c7cb0490fc8c52@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 syzkaller@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

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

* Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
  2025-12-16 10:06 syzbot
@ 2025-12-16 23:23 ` Raka Gunarto
  0 siblings, 0 replies; 4+ messages in thread
From: Raka Gunarto @ 2025-12-16 23:23 UTC (permalink / raw)
  To: syzbot
  Cc: andrew+netdev, davem, edumazet, kuba, Linux Kernel Mailing List,
	linux-usb, netdev, pabeni, petkan, syzkaller-bugs

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+8dd915c7cb0490fc8c52@syzkaller.appspotmail.com
Signed-off-by: Raka Gunarto <rakagunarto@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

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

* Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
       [not found] <CACUOwm+O5RbQ8OjH=RCLLqRt-vzQMJwv_aMg41iNabH_AgHVJw@mail.gmail.com>
@ 2025-12-16 23:37 ` syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-12-16 23:37 UTC (permalink / raw)
  To: rakagunarto; +Cc: rakagunarto, linux-kernel, syzkaller-bugs

> #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+8dd915c7cb0490fc8c52@syzkaller.appspotmail.com
> Signed-off-by: Raka Gunarto <rakagunarto@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;
>  }
> --

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

* Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
       [not found] <CACUOwmJ39NTytE0egqZ_ubuYGsiScsaEJcojzEk6tdXOSBcUGw@mail.gmail.com>
@ 2025-12-16 23:48 ` syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2025-12-16 23:48 UTC (permalink / raw)
  To: linux-kernel, rakagunarto, syzkaller-bugs

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
kernel config:  https://syzkaller.appspot.com/x/.config?x=9a0268003e02068d
dashboard link: https://syzkaller.appspot.com/bug?extid=8dd915c7cb0490fc8c52
compiler:       
patch:          https://syzkaller.appspot.com/x/patch.diff?x=1013931a580000


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

end of thread, other threads:[~2025-12-16 23:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CACUOwmJ39NTytE0egqZ_ubuYGsiScsaEJcojzEk6tdXOSBcUGw@mail.gmail.com>
2025-12-16 23:48 ` [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast syzbot
     [not found] <CACUOwm+O5RbQ8OjH=RCLLqRt-vzQMJwv_aMg41iNabH_AgHVJw@mail.gmail.com>
2025-12-16 23:37 ` syzbot
2025-12-16 10:06 syzbot
2025-12-16 23:23 ` Raka Gunarto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox