* [PATCH] Modules: x86_64 - R_X86_64_PC32 gives signed 32 bit and needs overflow check.
@ 2010-10-29 15:07 Nikanth Karthikesan
0 siblings, 0 replies; only message in thread
From: Nikanth Karthikesan @ 2010-10-29 15:07 UTC (permalink / raw)
To: Rusty Russell; +Cc: Ingo Molnar, linux-kernel, x86
R_X86_64_PC32 gives signed 32 bit and needs overflow check.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
---
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 8f29560..59b859a 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -168,11 +168,9 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
break;
case R_X86_64_PC32:
val -= (u64)loc;
- *(u32 *)loc = val;
-#if 0
+ *(s32 *)loc = val;
if ((s64)val != *(s32 *)loc)
goto overflow;
-#endif
break;
default:
printk(KERN_ERR "module %s: Unknown rela relocation: %llu\n",
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-29 15:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 15:07 [PATCH] Modules: x86_64 - R_X86_64_PC32 gives signed 32 bit and needs overflow check Nikanth Karthikesan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox