ACPI: pfr_update: Fix the driver update version check
PATCH 1/1 ACPI: pfr_update: Fix the driver update version check
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.
--- drivers/acpi/pfr_update.c | 2 +- include/uapi/linux/pfrut.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/pfr_update.c +1 -1
@@ -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,
include/uapi/linux/pfrut.h +1 -0
@@ -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 {
Signature · 1 line
2.25.1
Rafael J. Wysocki
maintainerQuoted 9 lines · Chen Yu
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" <[email protected]>Signed-off-by Chen Yu <[email protected]>
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?
Quoted 33 lines
--- drivers/acpi/pfr_update.c | 2 +- include/uapi/linux/pfrut.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)drivers/acpi/pfr_update.c +1
-1@@ -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,include/uapi/linux/pfrut.h +1
-1@@ -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
Hi Rafael,
thank you for taking a look,
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Chen Yu
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.
Quoted 5 lines
Quoted 2 lines
Reported-by "Govindarajulu, Hariganesh" <[email protected]>Signed-off-by Chen Yu <[email protected]>A Fixes: tag, please?
OK,
Quoted 3 lines
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
Quoted 33 lines
Quoted 33 lines
--- drivers/acpi/pfr_update.c | 2 +- include/uapi/linux/pfrut.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)drivers/acpi/pfr_update.c +1
-1@@ -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,include/uapi/linux/pfrut.h +1
-1@@ -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