lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] rt2x00: reset reg earlier in rt2500usb_register_read
On Thu, Jan 21, 2021 at 7:21 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Jan 21, 2021 at 06:59:08PM +0800, 慕冬亮 wrote:
> > > > rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ,
> > > > USB_VENDOR_REQUEST_IN, offset,
> > > > &reg, sizeof(reg));
> > >
> > > Are you sure this is valid to call this function with a variable on the
> > > stack like this? How did you test this change?
> >
> > First, I did not do any changes to this call. Second, the programming
> > style to pass the pointer of stack variable as arguments is not really
> > good. Third, I check this same code file, there are many code snippets
> > with such programming style. :(
>
> I know you did not change it, what I am asking is how did you test this
> change works? I think the kernel will warn you in huge ways that using
> this pointer on the stack is incorrect, which implies you did not test
> this change :(
>

I tested this patch only with PoC. The patched kernel version did not
crash when executing the PoC.

BTW, I did not take notice of the warning information as there are
many many warnings in building KMSAN.

> thanks,
>
> greg k-h

\
 
 \ /
  Last update: 2021-01-21 12:30    [W:0.057 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site