[PATCH] ACPI: MRRM: Check revision of MRRM table

Tony Luck posted 1 patch 3 months, 2 weeks ago
drivers/acpi/acpi_mrrm.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] ACPI: MRRM: Check revision of MRRM table
Posted by Tony Luck 3 months, 2 weeks ago
Before trying to parse the MRRM table, check that the table revision
is the one that is expected.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 drivers/acpi/acpi_mrrm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c
index 47ea3ccc2142..a6dbf623e557 100644
--- a/drivers/acpi/acpi_mrrm.c
+++ b/drivers/acpi/acpi_mrrm.c
@@ -63,6 +63,9 @@ static __init int acpi_parse_mrrm(struct acpi_table_header *table)
 	if (!mrrm)
 		return -ENODEV;
 
+	if (mrrm->header.revision != 1)
+		return -EINVAL;
+
 	if (mrrm->flags & ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS)
 		return -EOPNOTSUPP;
 
-- 
2.51.0
Re: [PATCH] ACPI: MRRM: Check revision of MRRM table
Posted by Rafael J. Wysocki 3 months, 2 weeks ago
On Wed, Oct 22, 2025 at 10:45 PM Tony Luck <tony.luck@intel.com> wrote:
>
> Before trying to parse the MRRM table, check that the table revision
> is the one that is expected.

OK, so should there be a Fixes: tag?  Or is it just a tidy-up of the code?

> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  drivers/acpi/acpi_mrrm.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c
> index 47ea3ccc2142..a6dbf623e557 100644
> --- a/drivers/acpi/acpi_mrrm.c
> +++ b/drivers/acpi/acpi_mrrm.c
> @@ -63,6 +63,9 @@ static __init int acpi_parse_mrrm(struct acpi_table_header *table)
>         if (!mrrm)
>                 return -ENODEV;
>
> +       if (mrrm->header.revision != 1)
> +               return -EINVAL;
> +
>         if (mrrm->flags & ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS)
>                 return -EOPNOTSUPP;
>
> --
> 2.51.0
>
>
RE: [PATCH] ACPI: MRRM: Check revision of MRRM table
Posted by Luck, Tony 3 months, 2 weeks ago
>> Before trying to parse the MRRM table, check that the table revision
>> is the one that is expected.
>
> OK, so should there be a Fixes: tag?  Or is it just a tidy-up of the code?

I'd be surprised if this table changed. But the h/w team that proposed the
MRRM table nagged me to check the revision "just in case". Which seems
like good practice.

Might as well add a Fixes to get this back ported in case someone locks onto
v6.16 or v6.17.

Fixes: b9020bdb9f76 ("ACPI: MRRM: Minimal parse of ACPI MRRM table")

Would you like me to post a V2, or can you just edit this in as you apply?

-Tony




Re: [PATCH] ACPI: MRRM: Check revision of MRRM table
Posted by Rafael J. Wysocki 3 months, 2 weeks ago
On Thu, Oct 23, 2025 at 5:56 PM Luck, Tony <tony.luck@intel.com> wrote:
>
> >> Before trying to parse the MRRM table, check that the table revision
> >> is the one that is expected.
> >
> > OK, so should there be a Fixes: tag?  Or is it just a tidy-up of the code?
>
> I'd be surprised if this table changed. But the h/w team that proposed the
> MRRM table nagged me to check the revision "just in case". Which seems
> like good practice.
>
> Might as well add a Fixes to get this back ported in case someone locks onto
> v6.16 or v6.17.
>
> Fixes: b9020bdb9f76 ("ACPI: MRRM: Minimal parse of ACPI MRRM table")
>
> Would you like me to post a V2, or can you just edit this in as you apply?

No worries, I can edit it.
Re: [PATCH] ACPI: MRRM: Check revision of MRRM table
Posted by Rafael J. Wysocki 3 months, 1 week ago
On Thu, Oct 23, 2025 at 6:01 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Oct 23, 2025 at 5:56 PM Luck, Tony <tony.luck@intel.com> wrote:
> >
> > >> Before trying to parse the MRRM table, check that the table revision
> > >> is the one that is expected.
> > >
> > > OK, so should there be a Fixes: tag?  Or is it just a tidy-up of the code?
> >
> > I'd be surprised if this table changed. But the h/w team that proposed the
> > MRRM table nagged me to check the revision "just in case". Which seems
> > like good practice.
> >
> > Might as well add a Fixes to get this back ported in case someone locks onto
> > v6.16 or v6.17.
> >
> > Fixes: b9020bdb9f76 ("ACPI: MRRM: Minimal parse of ACPI MRRM table")
> >
> > Would you like me to post a V2, or can you just edit this in as you apply?
>
> No worries, I can edit it.

Applied with the Fixed: tag added as 6.18-rc material, thanks!