lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zw6CntwUyqM6CivS@hog>
Date: Tue, 15 Oct 2024 16:56:30 +0200
From: Sabrina Dubroca <sd@...asysnail.net>
To: Jianbo Liu <jianbol@...dia.com>
Cc: Tariq Toukan <tariqt@...dia.com>,
	"David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
	Saeed Mahameed <saeedm@...dia.com>, Gal Pressman <gal@...dia.com>,
	Leon Romanovsky <leonro@...dia.com>,
	Patrisious Haddad <phaddad@...dia.com>, Chris Mi <cmi@...dia.com>
Subject: Re: [PATCH net] macsec: Fix use-after-free while sending the
 offloading packet

2024-10-15, 21:46:26 +0800, Jianbo Liu wrote:
> 
> 
> On 10/15/2024 6:28 PM, Sabrina Dubroca wrote:
> > 2024-10-15, 17:57:59 +0800, Jianbo Liu wrote:
> > > 
> > > 
> > > On 10/15/2024 4:56 PM, Sabrina Dubroca wrote:
> > > > 2024-10-14, 12:07:20 +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.
> > > > 
> > > > Ok. Then that packet is going to get dropped when it reaches the
> > > > driver, right? At this point the TXSA we need shouldn't be configured
> > > 
> > > I think so because dst's output should be updated.
> > 
> > What updates the dst when we're deleting the macsec device? And this
> > is just a metadata_dst, it's only useful to hold the SCI.
> > 
> 
> You are right. It's not updated.
> 
> > But I guess we would have the same issue when the macsec device still
> > exists but the TXSA is gone, so hopefully this is handled well by all
> > drivers.
> > 
> 
> And for now, I'd rather focus on fixing the kernel crash caused by UAF.

Ok, but please take a look at it very soon. Sending packets
unencrypted when they should be encrypted can be just as bad as
crashing the system.

-- 
Sabrina


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ