[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJedcCwAU+piERJcthGTOY4+MKqjrGNYiNVAvTN5JQ4ugrjPjg@mail.gmail.com>
Date: Fri, 17 Mar 2023 11:59:16 +0800
From: Zheng Hacker <hackerzheng666@...il.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Cc: Shuah Khan <skhan@...uxfoundation.org>,
Zheng Wang <zyytlz.wz@....com>,
"valentina.manea.m@...il.com" <valentina.manea.m@...il.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"1395428693sheep@...il.com" <1395428693sheep@...il.com>,
"alex000young@...il.com" <alex000young@...il.com>
Subject: Re: [PATCH v2] usbip: vudc: Fix use after free bug in vudc_remove due
to race condition
gregkh@...uxfoundation.org <gregkh@...uxfoundation.org> 于2023年3月17日周五 03:09写道:
>
> On Fri, Mar 17, 2023 at 02:27:05AM +0800, Zheng Hacker wrote:
> > 在 2023年3月17日星期五,Shuah Khan <skhan@...uxfoundation.org> 写道:
> >
> > > On 3/16/23 12:09, Zheng Wang wrote:
> > >
> > >> In vudc_probe, it calls init_vudc_hw, which bound &udc->timer with
> > >> v_timer.
> > >>
> > >> When it calls usbip_sockfd_store, it will call v_start_timer to start the
> > >> timer work.
> > >>
> > >> When we call vudc_remove to remove the driver, theremay be a sequence as
> > >> follows:
> > >>
> > >> Fix it by shutdown the timer work before cleanup in vudc_remove.
> > >>
> > >> Note that removing a driver is a root-only operation, and should never
> > >> happen.
> > >>
> > >> CPU0 CPU1
> > >>
> > >> |v_timer
> > >> vudc_remove |
> > >> kfree(udc); |
> > >> //free shost |
> > >> |udc->gadget
> > >> |//use
> > >>
> > >> This bug was found by static analysis.
> > >>
> > >
> > > Tell me which static analysis tool did you use to find this and
> > > the output from the tool.
> >
> >
> > This is found by codeql,the rule is complicated. It finally found
> > there is no timer stop behavior in remove function.
>
> When using tools like this, you are required to follow the rules in
> Documentation/process/researcher-guidelines.rst
>
> Please do so here.
>
Thanks for your assistance. I'll read it carefully and keep that in mind.
And I'll append more information in the next version of patch.
Best regards,
Zheng
> thanks,
>
> greg k-h
Powered by blists - more mailing lists