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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Jan 2009 16:29:06 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	Jeff Dike <jdike@...toit.com>, lkml <linux-kernel@...r.kernel.org>
CC:	uml-devel <user-mode-linux-devel@...ts.sourceforge.net>
Subject: [PATCH] x86, um: fix EXECUTE_SYSCALL macros

Roel Kluin wrote:
> When these macros aren't called with regs, e.g. with foo
> this will incorectly expand to foo->foo.gp[*]
> 
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> My other patch should probably as well have been sent to this list:
> http://lkml.org/lkml/2009/1/21/203
> 
there were more

Fix EXECUTE_SYSCALL macros. When called with a variable named other
than regs as second argument, this will result in a build failure.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
diff --git a/arch/um/sys-i386/shared/sysdep/syscalls.h b/arch/um/sys-i386/shared/sysdep/syscalls.h
index 9056981..1cab192 100644
--- a/arch/um/sys-i386/shared/sysdep/syscalls.h
+++ b/arch/um/sys-i386/shared/sysdep/syscalls.h
@@ -17,9 +17,9 @@ extern syscall_handler_t old_mmap_i386;
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	((long (*)(struct syscall_args)) \
-	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
+	 (*sys_call_table[syscall]))(SYSCALL_ARGS(&_regs->regs))
 
 extern long sys_mmap2(unsigned long addr, unsigned long len,
 		      unsigned long prot, unsigned long flags,
diff --git a/arch/um/sys-x86_64/shared/sysdep/syscalls.h b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
index 7cfb0b0..a5be219 100644
--- a/arch/um/sys-x86_64/shared/sysdep/syscalls.h
+++ b/arch/um/sys-x86_64/shared/sysdep/syscalls.h
@@ -15,14 +15,14 @@ typedef long syscall_handler_t(void);
 
 extern syscall_handler_t *sys_call_table[];
 
-#define EXECUTE_SYSCALL(syscall, regs) \
+#define EXECUTE_SYSCALL(syscall, _regs) \
 	(((long (*)(long, long, long, long, long, long)) \
-	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \
-		 		      UPT_SYSCALL_ARG2(&regs->regs), \
-				      UPT_SYSCALL_ARG3(&regs->regs), \
-				      UPT_SYSCALL_ARG4(&regs->regs), \
-				      UPT_SYSCALL_ARG5(&regs->regs), \
-				      UPT_SYSCALL_ARG6(&regs->regs)))
+	  (*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&_regs->regs), \
+		 		      UPT_SYSCALL_ARG2(&_regs->regs), \
+				      UPT_SYSCALL_ARG3(&_regs->regs), \
+				      UPT_SYSCALL_ARG4(&_regs->regs), \
+				      UPT_SYSCALL_ARG5(&_regs->regs), \
+				      UPT_SYSCALL_ARG6(&_regs->regs)))
 
 extern long old_mmap(unsigned long addr, unsigned long len,
 		     unsigned long prot, unsigned long flags,

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ