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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 May 2017 21:38:08 +0200 (CEST)
From:   Stefan Wahren <stefan.wahren@...e.com>
To:     Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Lino Sanfilippo <LinoSanfilippo@....de>
Cc:     linux-serial@...r.kernel.org, Jiri Slaby <jslaby@...e.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jakub Kicinski <kubakici@...pl>, devicetree@...r.kernel.org
Subject: Re: [PATCH v6 net-next 17/17] net: qualcomm: add QCA7000 UART
 driver


> Lino Sanfilippo <LinoSanfilippo@....de> hat am 23. Mai 2017 um 20:16 geschrieben:
> 
> 
> Hi,
> 
> On 23.05.2017 15:12, Stefan Wahren wrote:
> 
> 
> > +}
> > +
> > +static void qca_uart_remove(struct serdev_device *serdev)
> > +{
> > +	struct qcauart *qca = serdev_device_get_drvdata(serdev);
> > +
> > +	netif_carrier_off(qca->net_dev);
> > +	cancel_work_sync(&qca->tx_work);
> > +	unregister_netdev(qca->net_dev);
> 
> Note that it is still possible that the tx work is queued right after cancel_work_sync()
> returned and before the net device is unregistered (and thus the check for the net device
> being up at the beginning of the tx work function is passed and the function is executed).

Even if the carrier is off? Since i see this pattern in some drivers, can you please point me to a reference like a thread or something else?

> I suggest to avoid this possible race by first unregistering the netdevice and then 
> calling cancel_work_sync().

What makes you sure that's safe to unregister the netdev while the tx work queue is possibly active?

> Regards,
> Lino 
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ