[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9bdeba5e-0f33-c1d9-4cb4-6fdb42ec2fa9@linux.intel.com>
Date: Mon, 4 Mar 2024 15:22:47 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Shravan Kumar Ramani <shravankr@...dia.com>
cc: Hans de Goede <hdegoede@...hat.com>, Vadim Pasternak <vadimp@...dia.com>,
platform-driver-x86@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] platform/mellanox: mlxbf-pmc: fix signedness bugs
On Thu, 29 Feb 2024, Dan Carpenter wrote:
> These need to be signed for the error handling to work. The
> mlxbf_pmc_get_event_num() function returns int so int type is correct.
>
> Fixes: 1ae9ffd303c2 ("platform/mellanox: mlxbf-pmc: Cleanup signed/unsigned mix-up")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> The code in mlxbf_pmc_valid_range() has a check for negatives but that
> has a signedness bug too. Fortunately "(u32)-EINVAL + 8" will not
> result in an integer overflow so the offset is treated as invalid.
Hi,
While this patch itself was fine so I applied it, when reviewing the patch
I noticed that some of the kstrtouint() derived values were not properly
bound checked (some were fed directly to FIELD_PREP()).
--
i.
Powered by blists - more mailing lists