Re: Re: [PATCH] staging: rtl8712: check register_netdev() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 10, 2020 at 11:05:34PM +0800, shaojie.dong@xxxxxxxxxxxxxxxx wrote:
> Hi
> 
> > 
> > This function should not be calling register_netdev().  What does that
> > have to do with firmware?  It should also not free_netdev() because
> > that will just lead to a use after free in the caller.
> >
> 
> --&gt; check code history author<larry.finger@xxxxxxxxxxxx> changed synchronous firmware loading to asynchronous firmware loading
>     before this change, register_netdev() was not calling in firmware related function.
>     For asynchronous loading, maybe register_netdev() be calling in rtl871x_load_fw_cb() is to ensure the netdev be registered after firmware loading completed
> 
> --&gt; for potential use after free issue
>     Could I only call "free_irq(adapter-&gt;pnetdev-&gt;irq, adapter-&gt;pnetdev)" when register_netdev() failed ?
>     If no need to change drivers/staging/rtl8712/hal_init.c file, I could give up my patch, thank you !
> 

Cleaning this up is a bit complicated and requires reworking the
firmware loading and it requires testing.  I don't think you have the
hardware to actually test this driver?  Probably, just leave this code
for another day.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux