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, 18 Aug 2016 08:06:36 -0500
From:	Josh Poimboeuf <jpoimboe@...hat.com>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...nel.org>,
	"H . Peter Anvin" <hpa@...or.com>
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Andy Lutomirski <luto@...capital.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Brian Gerst <brgerst@...il.com>,
	Kees Cook <keescook@...omium.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Byungchul Park <byungchul.park@....com>,
	Nilay Vaish <nilayvaish@...il.com>
Subject: [PATCH v4 56/57] x86/mm: removed unused arch_within_stack_frames() arguments

Remove two unused arch_within_stack_frames() arguments: 'stack' and
'stackend'.  The x86 unwinder already knows how to find the stack
bounds, and that's generally the case for other arch unwinders as well.

Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
---
 arch/x86/include/asm/thread_info.h | 8 ++------
 arch/x86/lib/usercopy.c            | 4 +---
 include/linux/thread_info.h        | 4 +---
 mm/usercopy.c                      | 3 +--
 4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 0f27e04..530789b 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -178,14 +178,10 @@ static inline unsigned long current_stack_pointer(void)
 
 #ifdef CONFIG_HARDENED_USERCOPY
 #ifdef CONFIG_FRAME_POINTER
-int arch_within_stack_frames(const void * const stack,
-			     const void * const stackend,
-			     void *first_frame,
+int arch_within_stack_frames(void *first_frame,
 			     const void *obj, unsigned long len);
 #else
-static inline int arch_within_stack_frames(const void * const stack,
-					   const void * const stackend,
-					   void *first_frame
+static inline int arch_within_stack_frames(void *first_frame,
 					   const void *obj, unsigned long len)
 {
 	return 0;
diff --git a/arch/x86/lib/usercopy.c b/arch/x86/lib/usercopy.c
index fe0b233..3045da7 100644
--- a/arch/x86/lib/usercopy.c
+++ b/arch/x86/lib/usercopy.c
@@ -46,9 +46,7 @@ EXPORT_SYMBOL_GPL(copy_from_user_nmi);
  *		-1 if placed across a frame boundary (or outside stack)
  *		 0 unable to determine (no frame pointers, etc)
  */
-int arch_within_stack_frames(const void * const stack,
-			     const void * const stackend,
-			     void *first_frame,
+int arch_within_stack_frames(void *first_frame,
 			     const void *obj, unsigned long len)
 {
 	struct unwind_state state;
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index aa58813..74d99e2 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -106,9 +106,7 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
 #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
 
 #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
-static inline int arch_within_stack_frames(const void * const stack,
-					   const void * const stackend,
-					   void *first_frame,
+static inline int arch_within_stack_frames(void *first_frame,
 					   const void *obj, unsigned long len)
 {
 	return 0;
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 359249c..7b2585a 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -58,8 +58,7 @@ static __always_inline int check_stack_object(const void *obj,
 	 * Starting with the caller's stack frame, check if the object
 	 * is safely within a valid frame.
 	 */
-	ret = arch_within_stack_frames(stack, stackend,
-				       __builtin_frame_address(0), obj, len);
+	ret = arch_within_stack_frames(__builtin_frame_address(0), obj, len);
 	if (ret)
 		return ret;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ