platform/x86: hp-wmi: Fix board_params typo for 8DD6 board
Subsystems (2)
PATCH 1/1 platform/x86: hp-wmi: Fix board_params typo for 8DD6 board
When adding support for board 8DD6, &omen_v1_no_ec_thermal_params was passed as driver_data instead of &omen_v1_no_ec_board_params.
Because active_board_params expects a pointer to struct hp_wmi_board_params, dereferencing active_board_params->thermal_profile results in a type confusion bug and invalid memory access. Update the entry to point to omen_v1_no_ec_board_params.
--- drivers/platform/x86/hp/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/hp/hp-wmi.c +1 -1
@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = { }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") }, - .driver_data = (void *)&omen_v1_no_ec_thermal_params, + .driver_data = (void *)&omen_v1_no_ec_board_params, }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },
Signature · 1 line
2.55.0
Quoted 2 lines · Arda Doğu Ari
When adding support for board 8DD6,
&omen_v1_no_ec_thermal_paramswas passed asdriver_datainstead of&omen_v1_no_ec_board_params.
Hi,
When I added support for 8DD6 [1] &omen_v1_no_ec_thermal_params was indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.
Quoted 4 lines
Because
active_board_paramsexpects a pointer to structhp_wmi_board_params, dereferencingactive_board_params->thermal_profileresults in a type confusion bug and invalid memory access. Update the entry to point toomen_v1_no_ec_board_params.
Thank you very much for observing and sending a patch for the same.
[1]: https://lore.kernel.org/platform-driver-x86/[email protected]
[2]: https://lore.kernel.org/platform-driver-x86/[email protected]
Quoted 23 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX 16-ak0xxx (8DD6)")Signed-off-by Arda Doğu Ari <[email protected]>---
drivers/platform/x86/hp/hp-wmi.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/hp/hp-wmi.c +1
-1@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = { }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") }, - .driver_data = (void *)&omen_v1_no_ec_thermal_params, + .driver_data = (void *)&omen_v1_no_ec_board_params, }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },Signature · 1 line
2.55.0
Ilpo Järvinen
maintainerQuoted 11 lines · Krishna Chomal
Quoted 2 lines · Arda Doğu Ari
When adding support for board 8DD6,
&omen_v1_no_ec_thermal_paramswas passed asdriver_datainstead of&omen_v1_no_ec_board_params.Hi,
When I added support for 8DD6 [1]
&omen_v1_no_ec_thermal_paramswas indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.
It's my fault for not catching it (though to my defence, I got sick around the time the merge window ends so I had less time for handling the patches in the first place and I only now realize compiler won't catch this problem for me because the old structs are still there).
Quoted 6 lines
Quoted 4 lines
Because
active_board_paramsexpects a pointer to structhp_wmi_board_params, dereferencingactive_board_params->thermal_profileresults in a type confusion bug and invalid memory access. Update the entry to point toomen_v1_no_ec_board_params.Thank you very much for observing and sending a patch for the same.
I've queued the patch to the review-ilpo-fixes branch already. If Krishna wants to give a reviewed-by tag, I can still add that to the commit.
Signature · 1 line
i.
Quoted 32 lines
[1]:
https://lore.kernel.org/platform-driver-x86/[email protected]
[2]:
https://lore.kernel.org/platform-driver-x86/[email protected]Quoted 26 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX16-ak0xxx (8DD6)")
Signed-off-by Arda Doğu Ari <[email protected]>---
drivers/platform/x86/hp/hp-wmi.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/hp/hp-wmi.c +1
-1@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = { }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") }, - .driver_data = (void *)&omen_v1_no_ec_thermal_params, + .driver_data = (void *)&omen_v1_no_ec_board_params, }, {.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },Signature · 1 line
2.55.0
Krishna Chomal
Reviewed-byQuoted 14 lines · Ilpo Järvinen
Quoted 11 lines · Krishna Chomal
Quoted 2 lines · Arda Doğu Ari
When adding support for board 8DD6,
&omen_v1_no_ec_thermal_paramswas passed asdriver_datainstead of&omen_v1_no_ec_board_params.Hi,
When I added support for 8DD6 [1]
&omen_v1_no_ec_thermal_paramswas indeed the correct quirk. But because Radhey Kalra's board-specific feature data patch [2] was accepted first, my patch probably lead to a merge conflict that had to be resolved manually, which is why this is subtle bug got introduced in the first place.
Quoted 4 lines
It's my fault for not catching it (though to my defence, I got sick around the time the merge window ends so I had less time for handling the patches in the first place and I only now realize compiler won't catch this problem for me because the old structs are still there).
No problem, take care.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Because
active_board_paramsexpects a pointer to structhp_wmi_board_params, dereferencingactive_board_params->thermal_profileresults in a type confusion bug and invalid memory access. Update the entry to point toomen_v1_no_ec_board_params.Thank you very much for observing and sending a patch for the same.
I've queued the patch to the review-ilpo-fixes branch already. If Krishna wants to give a reviewed-by tag, I can still add that to the commit.
Quoted 35 lines
Signature · 1 line
i.Quoted 32 lines
[1]:
https://lore.kernel.org/platform-driver-x86/[email protected]
[2]:
https://lore.kernel.org/platform-driver-x86/[email protected]Quoted 26 lines
Fixes a7320d6eb9c42 ("platform/x86: hp-wmi: Add support for OMEN MAX16-ak0xxx (8DD6)")
Signed-off-by Arda Doğu Ari <[email protected]>---
drivers/platform/x86/hp/hp-wmi.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/hp/hp-wmi.c +1
-1@@ -337,7 +337,7 @@ static const struct dmi_system_id hp_wmi_feature_boards[] __initconst = { }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "8DD6") }, - .driver_data = (void *)&omen_v1_no_ec_thermal_params, + .driver_data = (void *)&omen_v1_no_ec_board_params, }, {.matches = { DMI_MATCH(DMI_BOARD_NAME, "8E35") },--
2.55.0
Ilpo Järvinen
maintainerQuoted 9 lines · Arda Doğu Ari
When adding support for board 8DD6,
&omen_v1_no_ec_thermal_paramswas passed asdriver_datainstead of&omen_v1_no_ec_board_params.Because
active_board_paramsexpects a pointer to structhp_wmi_board_params, dereferencingactive_board_params->thermal_profileresults in a type confusion bug and invalid memory access. Update the entry to point toomen_v1_no_ec_board_params.[...]
Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: hp-wmi: Fix board_params typo for 8DD6 board
commit: 9a71037abc42203caa9041906fb6d012390642a8
--
i.