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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG48ez1DPWhT2dhd1iptFawWjteh_=pZ4M6Yq5KKCq2DTArnqw@mail.gmail.com>
Date: Fri, 2 May 2025 14:28:21 +0200
From: Jann Horn <jannh@...gle.com>
To: David Laight <david.laight.linux@...il.com>
Cc: Jens Wiklander <jens.wiklander@...aro.org>, Sumit Garg <sumit.garg@...nel.org>, 
	op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tee: Prevent size calculation wraparound on 32-bit kernels

On Thu, May 1, 2025 at 10:02 PM David Laight
<david.laight.linux@...il.com> wrote:
>
> On Mon, 28 Apr 2025 15:06:43 +0200
> Jann Horn <jannh@...gle.com> wrote:
>
> > The current code around TEE_IOCTL_PARAM_SIZE() is a bit wrong on
> > 32-bit kernels: Multiplying a user-provided 32-bit value with the
> > size of a structure can wrap around on such platforms.
> >
> > Fix it by using saturating arithmetic for the size calculation.
>
> Why not just add a sanity check on 'num_params' after it is read.
> Max is 31 (1024-32)/32), but any sane limit will do because of
> the buf.buf_len test.

That would work, too. I don't know which way looks nicer.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ