* [PATCH] platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic
@ 2025-12-19 8:30 Junrui Luo
2025-12-22 14:43 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Junrui Luo @ 2025-12-19 8:30 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen, Vernon Mauery, Matthew Garrett
Cc: platform-driver-x86, linux-kernel, Yuhao Jiang, Junrui Luo
The ibm_rtl_init() function searches for the signature but has a pointer
arithmetic error. The loop counter suggests searching at 4-byte intervals
but the implementation only advances by 1 byte per iteration.
Fix by properly advancing the pointer by sizeof(unsigned int) bytes
each iteration.
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 35f0ce032b0f ("IBM Real-Time "SMI Free" mode driver -v7")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
---
drivers/platform/x86/ibm_rtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 231b37909801..139956168cf9 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -273,7 +273,7 @@ static int __init ibm_rtl_init(void) {
/* search for the _RTL_ signature at the start of the table */
for (i = 0 ; i < ebda_size/sizeof(unsigned int); i++) {
struct ibm_rtl_table __iomem * tmp;
- tmp = (struct ibm_rtl_table __iomem *) (ebda_map+i);
+ tmp = (struct ibm_rtl_table __iomem *) (ebda_map + i*sizeof(unsigned int));
if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) {
phys_addr_t addr;
unsigned int plen;
---
base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66
change-id: 20251219-fixes-4daa45346b5c
Best regards,
--
Junrui Luo <moonafterrain@outlook.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic
2025-12-19 8:30 [PATCH] platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic Junrui Luo
@ 2025-12-22 14:43 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-12-22 14:43 UTC (permalink / raw)
To: Hans de Goede, Vernon Mauery, Matthew Garrett, Junrui Luo
Cc: platform-driver-x86, linux-kernel, Yuhao Jiang
On Fri, 19 Dec 2025 16:30:29 +0800, Junrui Luo wrote:
> The ibm_rtl_init() function searches for the signature but has a pointer
> arithmetic error. The loop counter suggests searching at 4-byte intervals
> but the implementation only advances by 1 byte per iteration.
>
> Fix by properly advancing the pointer by sizeof(unsigned int) bytes
> each iteration.
>
> [...]
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: ibm_rtl: fix EBDA signature search pointer arithmetic
commit: 15dd100349b8526cbdf2de0ce3e72e700eb6c208
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-22 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 8:30 [PATCH] platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic Junrui Luo
2025-12-22 14:43 ` Ilpo Järvinen
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®