[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <173672406962.1487447.9603474833606557636.b4-ty@bootlin.com>
Date: Mon, 13 Jan 2025 00:21:21 +0100
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Esteban Blanc <eblanc@...libre.com>,
Dan Carpenter <dan.carpenter@...aro.org>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>, linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] rtc: tps6594: Fix integer overflow on 32bit systems
On Wed, 11 Dec 2024 12:32:34 +0300, Dan Carpenter wrote:
> The problem is this multiply in tps6594_rtc_set_offset()
>
> tmp = offset * TICKS_PER_HOUR;
>
> The "tmp" variable is an s64 but "offset" is a long in the
> (-277774)-277774 range. On 32bit systems a long can hold numbers up to
> approximately two billion. The number of TICKS_PER_HOUR is really large,
> (32768 * 3600) or roughly a hundred million. When you start multiplying
> by a hundred million it doesn't take long to overflow the two billion
> mark.
>
> [...]
Applied, thanks!
[1/1] rtc: tps6594: Fix integer overflow on 32bit systems
https://git.kernel.org/abelloni/c/09c4a6101532
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists