All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikanth Karthikesan <knikanth@suse.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: [PATCH] Modules: x86_64 - R_X86_64_PC32 gives signed 32 bit and needs overflow check.
Date: Fri, 29 Oct 2010 20:37:32 +0530	[thread overview]
Message-ID: <201010292037.32588.knikanth@suse.de> (raw)

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",

                 reply	other threads:[~2010-10-29 15:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010292037.32588.knikanth@suse.de \
    --to=knikanth@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.