All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	 Shravan Kumar Ramani <shravankr@nvidia.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Vadim Pasternak <vadimp@nvidia.com>,
	 platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	 kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/mellanox: mlxbf-pmc: fix signedness bugs
Date: Mon, 4 Mar 2024 15:22:47 +0200 (EET)	[thread overview]
Message-ID: <9bdeba5e-0f33-c1d9-4cb4-6fdb42ec2fa9@linux.intel.com> (raw)
In-Reply-To: <a4af764e-990b-4ebd-b342-852844374032@moroto.mountain>

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@linaro.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.


      parent reply	other threads:[~2024-03-04 13:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 13:11 [PATCH] platform/mellanox: mlxbf-pmc: fix signedness bugs Dan Carpenter
2024-03-04 13:17 ` Ilpo Järvinen
2024-03-04 13:22 ` Ilpo Järvinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bdeba5e-0f33-c1d9-4cb4-6fdb42ec2fa9@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=shravankr@nvidia.com \
    --cc=vadimp@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.