linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: pfr_update: Fix the driver update version check
@ 2025-07-22 14:32 Chen Yu
  2025-07-22 15:03 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Yu @ 2025-07-22 14:32 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Len Brown, linux-acpi, linux-kernel, Chen Yu, Chen Yu,
	Govindarajulu, Hariganesh

The security-version-number check should be used rather
than the runtime version check for driver update. Otherwise
the firmware update would fail when the update binary
has a lower number of the runtime version than the
current one.

Reported-by: "Govindarajulu, Hariganesh" <hariganesh.govindarajulu@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
---
 drivers/acpi/pfr_update.c  | 2 +-
 include/uapi/linux/pfrut.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pfr_update.c b/drivers/acpi/pfr_update.c
index 031d1ba81b86..08b9b2bc2d97 100644
--- a/drivers/acpi/pfr_update.c
+++ b/drivers/acpi/pfr_update.c
@@ -310,7 +310,7 @@ static bool applicable_image(const void *data, struct pfru_update_cap_info *cap,
 	if (type == PFRU_CODE_INJECT_TYPE)
 		return payload_hdr->rt_ver >= cap->code_rt_version;
 
-	return payload_hdr->rt_ver >= cap->drv_rt_version;
+	return payload_hdr->svn_ver >= cap->drv_svn;
 }
 
 static void print_update_debug_info(struct pfru_updated_result *result,
diff --git a/include/uapi/linux/pfrut.h b/include/uapi/linux/pfrut.h
index 42fa15f8310d..b77d5c210c26 100644
--- a/include/uapi/linux/pfrut.h
+++ b/include/uapi/linux/pfrut.h
@@ -89,6 +89,7 @@ struct pfru_payload_hdr {
 	__u32 hw_ver;
 	__u32 rt_ver;
 	__u8 platform_id[16];
+	__u32 svn_ver;
 };
 
 enum pfru_dsm_status {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: pfr_update: Fix the driver update version check
  2025-07-22 14:32 [PATCH] ACPI: pfr_update: Fix the driver update version check Chen Yu
@ 2025-07-22 15:03 ` Rafael J. Wysocki
  2025-07-22 15:27   ` Chen, Yu C
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-07-22 15:03 UTC (permalink / raw)
  To: Chen Yu
  Cc: Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel, Chen Yu,
	Govindarajulu, Hariganesh

On Tue, Jul 22, 2025 at 4:39 PM Chen Yu <yu.c.chen@intel.com> wrote:
>
> The security-version-number check should be used rather
> than the runtime version check for driver update. Otherwise
> the firmware update would fail when the update binary
> has a lower number of the runtime version than the
> current one.
>
> Reported-by: "Govindarajulu, Hariganesh" <hariganesh.govindarajulu@intel.com>
> Signed-off-by: Chen Yu <yu.c.chen@intel.com>

A Fixes: tag, please?

Also, this is unlikely to get into 6.17-rc1, but I can make it into
6.17-rc2 if it is urgent enough, so how urgent is it?

> ---
>  drivers/acpi/pfr_update.c  | 2 +-
>  include/uapi/linux/pfrut.h | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/pfr_update.c b/drivers/acpi/pfr_update.c
> index 031d1ba81b86..08b9b2bc2d97 100644
> --- a/drivers/acpi/pfr_update.c
> +++ b/drivers/acpi/pfr_update.c
> @@ -310,7 +310,7 @@ static bool applicable_image(const void *data, struct pfru_update_cap_info *cap,
>         if (type == PFRU_CODE_INJECT_TYPE)
>                 return payload_hdr->rt_ver >= cap->code_rt_version;
>
> -       return payload_hdr->rt_ver >= cap->drv_rt_version;
> +       return payload_hdr->svn_ver >= cap->drv_svn;
>  }
>
>  static void print_update_debug_info(struct pfru_updated_result *result,
> diff --git a/include/uapi/linux/pfrut.h b/include/uapi/linux/pfrut.h
> index 42fa15f8310d..b77d5c210c26 100644
> --- a/include/uapi/linux/pfrut.h
> +++ b/include/uapi/linux/pfrut.h
> @@ -89,6 +89,7 @@ struct pfru_payload_hdr {
>         __u32 hw_ver;
>         __u32 rt_ver;
>         __u8 platform_id[16];
> +       __u32 svn_ver;
>  };
>
>  enum pfru_dsm_status {
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: pfr_update: Fix the driver update version check
  2025-07-22 15:03 ` Rafael J. Wysocki
@ 2025-07-22 15:27   ` Chen, Yu C
  0 siblings, 0 replies; 3+ messages in thread
From: Chen, Yu C @ 2025-07-22 15:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Len Brown, linux-acpi, linux-kernel, Chen Yu,
	Govindarajulu, Hariganesh

Hi Rafael,

thank you for taking a look,

On 7/22/2025 11:03 PM, Rafael J. Wysocki wrote:
> On Tue, Jul 22, 2025 at 4:39 PM Chen Yu <yu.c.chen@intel.com> wrote:
>>
>> The security-version-number check should be used rather
>> than the runtime version check for driver update. Otherwise
>> the firmware update would fail when the update binary
>> has a lower number of the runtime version than the
>> current one.
>>
>> Reported-by: "Govindarajulu, Hariganesh" <hariganesh.govindarajulu@intel.com>
>> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> 
> A Fixes: tag, please?
> 

OK,
Fixes: commit 0db89fa243e5 ("ACPI: Introduce Platform Firmware Runtime 
Update device driver")

> Also, this is unlikely to get into 6.17-rc1, but I can make it into
> 6.17-rc2 if it is urgent enough, so how urgent is it?
>

It is not urgent because the internal tree has merged this patch and did 
not block
the testing. However, considering that this might prevent users from 
rolling back
versions in the production environment, fixing it earlier might be helpful.

thanks,
Chenyu
>> ---
>>   drivers/acpi/pfr_update.c  | 2 +-
>>   include/uapi/linux/pfrut.h | 1 +
>>   2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/pfr_update.c b/drivers/acpi/pfr_update.c
>> index 031d1ba81b86..08b9b2bc2d97 100644
>> --- a/drivers/acpi/pfr_update.c
>> +++ b/drivers/acpi/pfr_update.c
>> @@ -310,7 +310,7 @@ static bool applicable_image(const void *data, struct pfru_update_cap_info *cap,
>>          if (type == PFRU_CODE_INJECT_TYPE)
>>                  return payload_hdr->rt_ver >= cap->code_rt_version;
>>
>> -       return payload_hdr->rt_ver >= cap->drv_rt_version;
>> +       return payload_hdr->svn_ver >= cap->drv_svn;
>>   }
>>
>>   static void print_update_debug_info(struct pfru_updated_result *result,
>> diff --git a/include/uapi/linux/pfrut.h b/include/uapi/linux/pfrut.h
>> index 42fa15f8310d..b77d5c210c26 100644
>> --- a/include/uapi/linux/pfrut.h
>> +++ b/include/uapi/linux/pfrut.h
>> @@ -89,6 +89,7 @@ struct pfru_payload_hdr {
>>          __u32 hw_ver;
>>          __u32 rt_ver;
>>          __u8 platform_id[16];
>> +       __u32 svn_ver;
>>   };
>>
>>   enum pfru_dsm_status {
>> --
>> 2.25.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-22 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 14:32 [PATCH] ACPI: pfr_update: Fix the driver update version check Chen Yu
2025-07-22 15:03 ` Rafael J. Wysocki
2025-07-22 15:27   ` Chen, Yu C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).