[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241023115844.GO402847@kernel.org>
Date: Wed, 23 Oct 2024 12:58:44 +0100
From: Simon Horman <horms@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>,
Sabrina Dubroca <sd@...asysnail.net>, netdev@...r.kernel.org,
Saeed Mahameed <saeedm@...dia.com>, Gal Pressman <gal@...dia.com>,
Leon Romanovsky <leonro@...dia.com>,
Jianbo Liu <jianbol@...dia.com>,
Patrisious Haddad <phaddad@...dia.com>, Chris Mi <cmi@...dia.com>
Subject: Re: [PATCH net V2] macsec: Fix use-after-free while sending the
offloading packet
On Mon, Oct 21, 2024 at 01:03:09PM +0300, Tariq Toukan wrote:
> From: Jianbo Liu <jianbol@...dia.com>
>
> KASAN reports the following UAF. The metadata_dst, which is used to
> store the SCI value for macsec offload, is already freed by
> metadata_dst_free() in macsec_free_netdev(), while driver still use it
> for sending the packet.
>
> To fix this issue, dst_release() is used instead to release
> metadata_dst. So it is not freed instantly in macsec_free_netdev() if
> still referenced by skb.
>
> BUG: KASAN: slab-use-after-free in mlx5e_xmit+0x1e8f/0x4190 [mlx5_core]
> Read of size 2 at addr ffff88813e42e038 by task kworker/7:2/714
> [...]
...
> Fixes: 0a28bfd4971f ("net/macsec: Add MACsec skb_metadata_dst Tx Data path support")
> Signed-off-by: Jianbo Liu <jianbol@...dia.com>
> Reviewed-by: Patrisious Haddad <phaddad@...dia.com>
> Reviewed-by: Chris Mi <cmi@...dia.com>
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
> ---
> drivers/net/macsec.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> V2:
> - Removed NULL check before call to dst_release().
Thanks Jianbo, all, for the update.
Reviewed-by: Simon Horman <horms@...nel.org>
Please do follow up on the unencrypted packet issue flagged
by Sabrina in her review of v1 [1].
https://lore.kernel.org/all/Zw6CntwUyqM6CivS@hog/
...
Powered by blists - more mailing lists