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:   Mon, 26 Dec 2016 23:54:36 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     hock.leong.kweh@...el.com
Cc:     Joao.Pinto@...opsys.com, peppe.cavallaro@...com,
        seraphin.bonnaffe@...com, alexandre.torgue@...il.com,
        manabian@...il.com, niklas.cassel@...s.com, johan@...nel.org,
        pavel@....cz, boon.leong.ong@...el.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, weifeng.voon@...el.com,
        lars.persson@...s.com
Subject: Re: [PATCH] net: stmmac: synchronize stmmac_open and
 stmmac_dvr_probe

From: "Kweh, Hock Leong"	<hock.leong.kweh@...el.com>
Date: Tue, 27 Dec 2016 19:44:59 +0800

> From: "Kweh, Hock Leong" <hock.leong.kweh@...el.com>
> 
> If kernel module stmmac driver being loaded after OS booted, there is a
> race condition between stmmac_open() and stmmac_mdio_register(), which is
> invoked inside stmmac_dvr_probe(), and the error is showed in dmesg log as
> PHY not found and stmmac_open() failed:
 ...
> The resolution used wait_for_completion_interruptible() to synchronize
> stmmac_open() and stmmac_dvr_probe() to prevent the race condition
> happening.
> 
> Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@...el.com>

The proper thing to do is to make sure register_netdevice() is not
invoked until it is %100 safe to call stmmac_open().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ