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: <CY8PR11MB7195FEFA59AF60D8054C04C99794A@CY8PR11MB7195.namprd11.prod.outlook.com>
Date: Fri, 22 Dec 2023 18:45:06 +0000
From: "Register, Scott" <scott.register@...el.com>
To: "Lobakin, Aleksander" <aleksander.lobakin@...el.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>, "Kitszel,
 Przemyslaw" <przemyslaw.kitszel@...el.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "Lobakin, Aleksander"
	<aleksander.lobakin@...el.com>, Eric Dumazet <edumazet@...gle.com>, "Kubiak,
 Michal" <michal.kubiak@...el.com>, Simon Horman <horms@...nel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "David S. Miller"
	<davem@...emloft.net>
Subject: RE: [Intel-wired-lan] [PATCH iwl-net v2] idpf: fix corrupted frames
 and skb leaks in singleq mode

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Alexander Lobakin
> Sent: Monday, December 11, 2023 4:32 AM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: Fijalkowski, Maciej <maciej.fijalkowski@...el.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@...el.com>; linux-kernel@...r.kernel.org; Lobakin,
> Aleksander <aleksander.lobakin@...el.com>; Eric Dumazet
> <edumazet@...gle.com>; Kubiak, Michal <michal.kubiak@...el.com>;
> Simon Horman <horms@...nel.org>; netdev@...r.kernel.org; Jakub
> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; David S.
> Miller <davem@...emloft.net>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2] idpf: fix corrupted frames and
> skb leaks in singleq mode
> 
> idpf_ring::skb serves only for keeping an incomplete frame between
> several NAPI Rx polling cycles, as one cycle may end up before
> processing the end of packet descriptor. The pointer is taken from
> the ring onto the stack before entering the loop and gets written
> there after the loop exits. When inside the loop, only the onstack
> pointer is used.
> For some reason, the logics is broken in the singleq mode, where the
> pointer is taken from the ring each iteration. This means that if a
> frame got fragmented into several descriptors, each fragment will have
> its own skb, but only the last one will be passed up the stack
> (containing garbage), leaving the rest leaked.
> Then, on ifdown, rxq::skb is being freed only in the splitq mode, while
> it can point to a valid skb in singleq as well. This can lead to a yet
> another skb leak.
> Just don't touch the ring skb field inside the polling loop, letting
> the onstack skb pointer work as expected: build a new skb if it's the
> first frame descriptor and attach a frag otherwise. On ifdown, free
> rxq::skb unconditionally if the pointer is non-NULL.
> 
> Fixes: a5ab9ee0df0b ("idpf: add singleq start_xmit and napi poll")
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> Reviewed-by: Michal Kubiak <michal.kubiak@...el.com>
> Reviewed-by: Simon Horman <horms@...nel.org>
> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: Alexander Lobakin <aleksander.lobakin@...el.com>
> ---
> Tony, please add it to dev-queue instead of the first revision.
> 
> From v1[0]:
> * fix the related skb leak on ifdown;
> * fix subject prefix;
> * pick Reviewed-bys.
> 
> [0] https://lore.kernel.org/all/20231201143821.1091005-1-
> aleksander.lobakin@...el.com
> ---
>  drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c | 1 -
>  drivers/net/ethernet/intel/idpf/idpf_txrx.c         | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)

Tested-by: Scott Register <scott.register@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ