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: <f946074f-60ed-455f-bcc7-4364f15b9603@stanley.mountain>
Date: Fri, 10 Jan 2025 14:51:52 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Nicolas Pitre <npitre@...libre.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
	Kees Cook <kees@...nel.org>, Eric Biederman <ebiederm@...ssion.com>,
	linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] binfmt_flat: Fix integer overflow bug on 32 bit systems

Ping.

regards,
dan carpenter

On Wed, Dec 04, 2024 at 03:07:15PM +0300, Dan Carpenter wrote:
> Most of these sizes and counts are capped at 256MB so the math doesn't
> result in an integer overflow.  The "relocs" count needs to be checked
> as well.  Otherwise on 32bit systems the calculation of "full_data"
> could be wrong.
> 
> 	full_data = data_len + relocs * sizeof(unsigned long);
> 
> Fixes: c995ee28d29d ("binfmt_flat: prevent kernel dammage from corrupted executable headers")
> Cc: stable@...r.kernel.org
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  fs/binfmt_flat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
> index 390808ce935d..b5b5ca1a44f7 100644
> --- a/fs/binfmt_flat.c
> +++ b/fs/binfmt_flat.c
> @@ -478,7 +478,7 @@ static int load_flat_file(struct linux_binprm *bprm,
>  	 * 28 bits (256 MB) is way more than reasonable in this case.
>  	 * If some top bits are set we have probable binary corruption.
>  	*/
> -	if ((text_len | data_len | bss_len | stack_len | full_data) >> 28) {
> +	if ((text_len | data_len | bss_len | stack_len | relocs | full_data) >> 28) {
>  		pr_err("bad header\n");
>  		ret = -ENOEXEC;
>  		goto err;
> -- 
> 2.45.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ