Skip to contentSkip to conversation

Modules: x86_64 - R_X86_64_PC32 gives signed 32 bit and needs overflow check.

PATCH New Nikanth Karthikesan 1 participant 1 message Oct 29, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Modules: x86_64 - R_X86_64_PC32 gives signed 32 bit and needs overflow check.

R_X86_64_PC32 gives signed 32 bit and needs overflow check.

---

arch/x86/kernel/module.c +1 -3
index 8f29560..59b859a 100644
@@ -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",