mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivasa Ds <srinivasa@in.ibm.com>
To: prasanna@in.ibm.com, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	anil.s.keshavamurthy@intel.com, jkenisto@us.ibm.com,
	systemtap@sources.redhat.com, ak@suse.de
Cc: suzuki@in.ibm.com
Subject: Re: [RFC] [PATCH] To vunmap correct address in text_poke()(kprobes)
Date: Wed, 25 Jul 2007 20:51:50 +0530	[thread overview]
Message-ID: <200707252051.50412.srinivasa@in.ibm.com> (raw)
In-Reply-To: <20070725141117.GA7254@in.ibm.com>

Resending patch according to Prasanna's suggestion, CC'ing Andi Kleen.

Hit this issue when testing kprobes on x86_64 systems. We need to align 
vunmap() address to a page boundary in text_poke(). Patch below
==============================
Trying to vfree() bad address (ffffc20002233199)
WARNING: at mm/vmalloc.c:330 __vunmap()
 
  Call Trace:
  [<ffffffff8023d199>] sys_gettimeofday+0x0/0x62
   [<ffffffff8047636c>] text_poke+0x119/0x124
   [<ffffffff80476b42>] arch_arm_kprobe+0x1c/0x21
   [<ffffffff80477cfd>] __register_kprobe+0x28a/0x2ed
   [<ffffffff8815a039>] :gettimeofday:kprobe_init+0x39/0x65
   [<ffffffff8025b5cf>] sys_init_module+0x1626/0x1788
   [<ffffffff802aaf12>] dput+0x3f/0xfa
   [<ffffffff8026bf91>] audit_syscall_entry+0x141/0x174
   [<ffffffff8020bee5>] tracesys+0xdc/0xe1
========================================

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Signed-off-by: Suzuki K P   <suzuki@in.ibm.com>
Signed-off-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>

Index: linux-2.6.23-rc1/arch/i386/kernel/alternative.c
===================================================================
--- linux-2.6.23-rc1.orig/arch/i386/kernel/alternative.c	2007-07-23 
02:11:00.000000000 +0530
+++ linux-2.6.23-rc1/arch/i386/kernel/alternative.c	2007-07-25 
20:27:13.000000000 +0530
@@ -447,5 +447,5 @@ void __kprobes text_poke(void *oaddr, un
 	if (cpu_has_clflush)
 		asm("clflush (%0) " :: "r" (oaddr) : "memory");
 	if (addr != oaddr)
-		vunmap(addr);
+		vunmap((u8 *)((unsigned long)addr & PAGE_MASK));
 }



      reply	other threads:[~2007-07-25 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-25  6:51 Srinivasa Ds
2007-07-25 14:11 ` S. P. Prasanna
2007-07-25 15:21   ` Srinivasa Ds [this message]

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=200707252051.50412.srinivasa@in.ibm.com \
    --to=srinivasa@in.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasanna@in.ibm.com \
    --cc=suzuki@in.ibm.com \
    --cc=systemtap@sources.redhat.com \
    /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 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®