public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+8dd915c7cb0490fc8c52@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
Date: Tue, 16 Dec 2025 15:42:32 -0800	[thread overview]
Message-ID: <6941ee68.a70a0220.207337.0020.GAE@google.com> (raw)
In-Reply-To: <69412f2b.a70a0220.104cf0.034b.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast
Author: rakagunarto@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+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

On Tue, Dec 16, 2025 at 11:23 PM Raka Gunarto <rakagunarto@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+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

      parent reply	other threads:[~2025-12-16 23:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 10:06 [syzbot] [net?] [usb?] memory leak in rtl8150_set_multicast syzbot
2025-12-16 23:23 ` Raka Gunarto
2025-12-16 23:42 ` syzbot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6941ee68.a70a0220.207337.0020.GAE@google.com \
    --to=syzbot+8dd915c7cb0490fc8c52@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox