Thread (8 messages) flat view 8 messages, 4 authors, 2018-09-20

Re: [PATCH net-next 1/2] net: linkwatch: add check for netdevice being present to linkwatch_do_dev

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2018-09-19 14:25:49

On Tue, Sep 18, 2018 at 9:56 PM Heiner Kallweit [off-list ref] wrote:
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 <hkallweit1@gmail.com>
Survived 100 suspend/resume cycles on sh73a0/kzm9g and r8a73a4/ape6evm.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help