lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Jul 2007 12:21:49 +0530
From:	Srinivasa Ds <srinivasa@...ibm.com>
To:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>, ananth@...ibm.com,
	prasanna@...ibm.com, anil.s.keshavamurthy@...el.com,
	jkenisto@...ibm.com, systemtap@...rces.redhat.com
Cc:	suzuki@...ibm.com
Subject: [RFC] [PATCH] To vunmap correct address in text_poke()(kprobes)


When I was testing kprobes on x86_64 and I come across the below error message 
on latest 2.6.23-rc1 kernel.
==========================================
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

======================================================

This indicates that vunmap() is not receving the page-aligned address in 
text_poke(). So the below attached patch will address this issue. Please let 
me know your comments.

Signed-off-by: Srinivasa DS <srinivasa@...ibm.com>
Signed-off-by: Suzuki K P   <suzuki@...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 
11:45:53.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(addr-(((unsigned long)oaddr) % PAGE_SIZE));
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists