mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Horgan <ben.horgan@arm.com>
To: Ping Li <leeonion.muyu@gmail.com>, james.morse@arm.com
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, reinette.chatre@intel.com,
	fenghuay@nvidia.com
Subject: Re: [PATCH] arm_mpam: Reject ris_idx == MPAM_MSC_MAX_NUM_RIS
Date: Mon, 26 Oct 2026 12:16:23 +0000	[thread overview]
Message-ID: <c5afae4a-c8cc-481c-8c98-8a0f84db1911@arm.com> (raw)
In-Reply-To: <20261022085710.1597276-1-leeonion.muyu@gmail.com>

Hi Ping,

On 22/10/2026 09:57, Ping Li wrote:
> While checking the driver's partid and ris bound checks, after the
> hardware team mistakenly configured PARTID_MAX in an MSC to 16,
> this issue was found: MPAM_MSC_MAX_NUM_RIS is the max number of
> RIS an MSC can have, so a ris_idx of 16 passes the current check,
> and would later be silently truncated to 0 by FIELD_PREP(),
> landing all configuration for that ris on RIS 0.
> 
> Signed-off-by: Ping Li <leeonion.muyu@gmail.com>

Thanks for the patch. Yin already found the same bug and posted a fix first so I'll go with that one.

https://lore.kernel.org/linux-arm-kernel/20261008-mpam-resctrl-dt-knp-support-v3-1-35196c2b43bf@oss.qualcomm.com/

Thanks,

Ben

> ---
>  drivers/resctrl/mpam_devices.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 48adc49b833c..347a5a6d6a1d 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c
> @@ -700,7 +700,7 @@ static int mpam_ris_create_locked(struct mpam_msc *msc, u8 ris_idx,
>  
>  	lockdep_assert_held(&mpam_list_lock);
>  
> -	if (ris_idx > MPAM_MSC_MAX_NUM_RIS)
> +	if (ris_idx >= MPAM_MSC_MAX_NUM_RIS)
>  		return -EINVAL;
>  
>  	if (test_and_set_bit(ris_idx, &msc->ris_idxs))


      reply	other threads:[~2026-10-26 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  8:57 Ping Li
2026-10-26 12:16 ` Ben Horgan [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=c5afae4a-c8cc-481c-8c98-8a0f84db1911@arm.com \
    --to=ben.horgan@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=leeonion.muyu@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®