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]
Date: Mon, 25 Mar 2024 12:30:05 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Denis Arefev <arefev@...mel.ru>
Cc: Miquel Raynal <miquel.raynal@...tlin.com>,
	Richard Weinberger <richard@....at>,
	Vignesh Raghavendra <vigneshr@...com>,
	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org, trufanov@...mel.ru, vfh@...mel.ru
Subject: Re: [PATCH] mtd: partitions: redboot: Added conversion of operands
 to a larger type

On Fri, Mar 15, 2024 at 12:37:58PM +0300, Denis Arefev wrote:
> The value of an arithmetic expression directory * master->erasesize is
> subject to overflow due to a failure to cast operands to a larger data
> type before perfroming arithmetic

..

> -		offset = directory * master->erasesize;
> +		offset = (unsigned long) directory * master->erasesize;

Usage of explicit casting can be avoided by using size_mul() from overflow.h.
Usually explicit castings are prone to subtle errors.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ