* [PATCH] arm: kernel: module: Remove the r_offset check which is always false
@ 2011-05-06 16:51 Maxin John
0 siblings, 0 replies; only message in thread
From: Maxin John @ 2011-05-06 16:51 UTC (permalink / raw)
To: linux-arm-kernel
Checking the unsigned 'r_offset' for less than zero will always be false.
Signed-off-by: Maxin B. John <maxin.john@gmail.com>
---
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index fee7c36..fc74bd3 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -92,7 +92,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char
*strtab, unsigned int symindex,
sym = ((Elf32_Sym *)symsec->sh_addr) + offset;
symname = strtab + sym->st_name;
- if (rel->r_offset < 0 || rel->r_offset >
dstsec->sh_size - sizeof(u32)) {
+ if (rel->r_offset > dstsec->sh_size - sizeof(u32)) {
pr_err("%s: section %u reloc %u sym '%s': out
of bounds relocation, offset %d size %u\n",
module->name, relindex, i, symname,
rel->r_offset, dstsec->sh_size);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-06 16:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06 16:51 [PATCH] arm: kernel: module: Remove the r_offset check which is always false Maxin John
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).