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: <aTh03SMwEsCB_fh3@horms.kernel.org>
Date: Tue, 9 Dec 2025 19:13:33 +0000
From: Simon Horman <horms@...nel.org>
To: Junrui Luo <moonafterrain@...look.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Sjur Braendeland <sjur.brandeland@...ricsson.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Yuhao Jiang <danisjiang@...il.com>
Subject: Re: [PATCH] caif: fix integer underflow in cffrml_receive()

On Thu, Dec 04, 2025 at 09:30:47PM +0800, Junrui Luo wrote:
> The cffrml_receive() function extracts a length field from the packet
> header and, when FCS is disabled, subtracts 2 from this length without
> validating that len >= 2.
> 
> If an attacker sends a malicious packet with a length field of 0 or 1
> to an interface with FCS disabled, the subtraction causes an integer
> underflow.
> 
> This can lead to memory exhaustion and kernel instability, potential
> information disclosure if padding contains uninitialized kernel memory.
> 
> Fix this by validating that len >= 2 before performing the subtraction.
> 
> Reported-by: Yuhao Jiang <danisjiang@...il.com>
> Reported-by: Junrui Luo <moonafterrain@...look.com>
> Fixes: b482cd2053e3 ("net-caif: add CAIF core protocol stack")
> Signed-off-by: Junrui Luo <moonafterrain@...look.com>

Hi Junrui,

I agree with your analysis and that the problem was introduced
by the cited commit.

I think that this function could benefit with a goto label that is jumped
to by all of the cases that follow the same error handling logic as this
one - I count 4 including this one.  But as a minimal bug fix I agree this
is a good approach.

No need to repost, but in future please consider targeting networking
bug fixes at the net tree like this:

Subject: [PATCH net] ...

Reviewed-by: Simon Horman <horms@...nel.org>

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ