From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32448 invoked by alias); 25 Jul 2007 15:22:12 -0000 Received: (qmail 32439 invoked by uid 22791); 25 Jul 2007 15:22:10 -0000 X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ausmtp06.au.ibm.com (HELO ausmtp06.au.ibm.com) (202.81.18.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 25 Jul 2007 15:22:04 +0000 Received: from sd0109e.au.ibm.com (d23rh905.au.ibm.com [202.81.18.225]) by ausmtp06.au.ibm.com (8.13.8/8.13.8) with ESMTP id l6PFMfJm4694138 for ; Thu, 26 Jul 2007 01:22:43 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0109e.au.ibm.com (8.13.8/8.13.8/NCO v8.4) with ESMTP id l6PFPQr5198260 for ; Thu, 26 Jul 2007 01:25:26 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l6PFLqdH004065 for ; Thu, 26 Jul 2007 01:21:53 +1000 Received: from srinivasa-laptop.in.ibm.com (srinivasa-laptop.in.ibm.com [9.124.35.39]) by d23av02.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l6PFLqPm004016; Thu, 26 Jul 2007 01:21:52 +1000 From: Srinivasa Ds Organization: IBM To: prasanna@in.ibm.com, linux-kernel@vger.kernel.org, Andrew Morton , anil.s.keshavamurthy@intel.com, jkenisto@us.ibm.com, systemtap@sources.redhat.com, ak@suse.de Subject: Re: [RFC] [PATCH] To vunmap correct address in text_poke()(kprobes) Date: Wed, 25 Jul 2007 17:33:00 -0000 User-Agent: KMail/1.9.6 Cc: suzuki@in.ibm.com References: <200707251221.49827.srinivasa@in.ibm.com> <20070725141117.GA7254@in.ibm.com> In-Reply-To: <20070725141117.GA7254@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707252051.50412.srinivasa@in.ibm.com> X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00181.txt.bz2 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: [] sys_gettimeofday+0x0/0x62 [] text_poke+0x119/0x124 [] arch_arm_kprobe+0x1c/0x21 [] __register_kprobe+0x28a/0x2ed [] :gettimeofday:kprobe_init+0x39/0x65 [] sys_init_module+0x1626/0x1788 [] dput+0x3f/0xfa [] audit_syscall_entry+0x141/0x174 [] tracesys+0xdc/0xe1 ======================================== Signed-off-by: Srinivasa DS Signed-off-by: Suzuki K P Signed-off-by: Prasanna S Panchamukhi 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)); }