[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALzJLG-4kbK=bnHrizOpJfaTJjvZQXOyNn=YHkwyb2xCf=Ti=g@mail.gmail.com>
Date: Thu, 1 Dec 2016 17:23:10 +0200
From: Saeed Mahameed <saeedm@....mellanox.co.il>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Jesper Dangaard Brouer <brouer@...hat.com>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [PATCH net-next] mlx4: fix use-after-free in mlx4_en_fold_software_stats()
On Thu, Dec 1, 2016 at 3:02 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> From: Eric Dumazet <edumazet@...gle.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@...gle.com>
> Reported-and-bisected-by: Jesper Dangaard Brouer <brouer@...hat.com>
> Tested-by: Jesper Dangaard Brouer <brouer@...hat.com>
> Cc: Tariq Toukan <tariqt@...lanox.com>
> Cc: Saeed Mahameed <saeedm@....mellanox.co.il>
Acked-by: Saeed Mahameed <saeedm@...lanox.com>
Powered by blists - more mailing lists