lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD-N9QWiu=6QefJaWzfUS3ep-8so+KBv-=S0LQs+EqO3tf8Cew@mail.gmail.com>
Date:   Sat, 22 May 2021 08:43:25 +0800
From:   慕冬亮 <mudongliangabcd@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
        rkovhaev@...il.com, straube.linux@...il.com,
        linux-staging@...ts.linux.dev,
        linux-kernel <linux-kernel@...r.kernel.org>,
        syzbot+1c46f3771695bccbdb3a@...kaller.appspotmail.com
Subject: Re: [PATCH v2] staging: rtl8712: Fix memory leak in r8712_init_recv_priv

On Sat, May 22, 2021 at 1:02 AM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Sat, May 22, 2021 at 12:25:19AM +0800, Dongliang Mu wrote:
> > r871xu_dev_remove failed to call r8712_free_drv_sw() and free the
> > resource (e.g., struct urb) due to the failure of firmware loading.
> >
> > Fix this by invoking r8712_free_drv_sw at the failure site.
> >
> > Reported-by: syzbot+1c46f3771695bccbdb3a@...kaller.appspotmail.com
> > Fixes: b4383c971bc5 ("staging: rtl8712: handle firmware load failure")
> > Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
> > ---
> > v1->v2: fix the initialization of pnetdev
> >
> >  drivers/staging/rtl8712/usb_intf.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
> > index dc21e7743349..57e773464e18 100644
> > --- a/drivers/staging/rtl8712/usb_intf.c
> > +++ b/drivers/staging/rtl8712/usb_intf.c
> > @@ -593,13 +593,14 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
> >       struct usb_device *udev = interface_to_usbdev(pusb_intf);
> >
> >       if (pnetdev) {
> > +             struct net_device *newpnetdev = NULL;
> >               struct _adapter *padapter = netdev_priv(pnetdev);
> >
> >               /* never exit with a firmware callback pending */
> >               wait_for_completion(&padapter->rtl8712_fw_ready);
> > -             pnetdev = usb_get_intfdata(pusb_intf);
> > +             newpnetdev = usb_get_intfdata(pusb_intf);
>
> Please learn a bit more C knowledge before messing around in the kernel
> tree.  Between the mistake in this chunk you added, and the mistake in
> the previous submission, I think you need more experience here as there
> are some things you still need to learn.

I am a kernel newbie in developing patches for Linux kernel. Sorry for
my naive mistakes. I will learn more and then submit some "good"
patches.

BTW, I think I have pointed out the underlying bug here, you guys can
fix it yourself.

>
> Best of luck!
>
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ