Thread (33 messages) 33 messages, 6 authors, 2016-12-04

Re: [PATCH net-next] mlx4: fix use-after-free in mlx4_en_fold_software_stats()

From: David Miller <davem@davemloft.net>
Date: 2016-12-02 18:37:02

From: Eric Dumazet <redacted>
Date: Thu, 01 Dec 2016 05:02:06 -0800
From: Eric Dumazet <edumazet@google.com>

My recent commit to get more precise rx/tx counters in ndo_get_stats64()
can lead to crashes at device dismantle, as Jesper found out.

We must prevent mlx4_en_fold_software_stats() trying to access
tx/rx rings if they are deleted.

Fix this by adding a test against priv->port_up in
mlx4_en_fold_software_stats()

Calling mlx4_en_fold_software_stats() from mlx4_en_stop_port()
allows us to eventually broadcast the latest/current counters to
rtnetlink monitors.

Fixes: 40931b85113d ("mlx4: give precise rx/tx bytes/packets counters")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-and-bisected-by: Jesper Dangaard Brouer [off-list ref]
Tested-by: Jesper Dangaard Brouer <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help