]> Git Repo - linux.git/commit
net: linkwatch: add check for netdevice being present to linkwatch_do_dev
authorHeiner Kallweit <[email protected]>
Tue, 18 Sep 2018 19:55:36 +0000 (21:55 +0200)
committerDavid S. Miller <[email protected]>
Thu, 20 Sep 2018 04:06:46 +0000 (21:06 -0700)
commit124eee3f6955f7aa19b9e6ff5c9b6d37cb3d1e2c
treefb42d27e933440f5295eaace7a973b3e830011d1
parent822143acf94f647aba7ed2e20e0e629485c1e43d
net: linkwatch: add check for netdevice being present to linkwatch_do_dev

When bringing down the netdevice (incl. detaching it) and calling
netif_carrier_off directly or indirectly the latter triggers an
asynchronous linkwatch event.
This linkwatch event eventually may fail to access chip registers in
the ndo_get_stats/ndo_get_stats64 callback because the device isn't
accessible any longer, see call trace in [0].

To prevent this scenario don't check for IFF_UP only, but also make
sure that the netdevice is present.

[0] https://lists.openwall.net/netdev/2018/03/15/62

Signed-off-by: Heiner Kallweit <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/link_watch.c
This page took 0.047335 seconds and 4 git commands to generate.