[PATCH v4 56/57] x86/mm: removed unused arch_within_stack_frames() arguments
From: Josh Poimboeuf
Date: Thu Aug 18 2016 - 09:08:33 EST
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@xxxxxxxxxx>
---
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