Skip to content

Commit

Permalink
stackleak: let stack_erasing_sysctl take a kernel pointer buffer
Browse files Browse the repository at this point in the history
Commit 3292739 ("sysctl: pass kernel pointers to ->proc_handler")
changed ctl_table.proc_handler to take a kernel pointer.  Adjust the
signature of stack_erasing_sysctl to match ctl_table.proc_handler which
fixes the following sparse warning:

kernel/stackleak.c:31:50: warning: incorrect type in argument 3 (different address spaces)
kernel/stackleak.c:31:50:    expected void *
kernel/stackleak.c:31:50:    got void [noderef] __user *buffer

Fixes: 3292739 ("sysctl: pass kernel pointers to ->proc_handler")
Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Al Viro <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tklauser authored and torvalds committed Sep 19, 2020
1 parent 7bb82ac commit 4773ef3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/stackleak.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static inline void stackleak_task_init(struct task_struct *t)

#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE
int stack_erasing_sysctl(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
void *buffer, size_t *lenp, loff_t *ppos);
#endif

#else /* !CONFIG_GCC_PLUGIN_STACKLEAK */
Expand Down
2 changes: 1 addition & 1 deletion kernel/stackleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass);

int stack_erasing_sysctl(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
void *buffer, size_t *lenp, loff_t *ppos)
{
int ret = 0;
int state = !static_branch_unlikely(&stack_erasing_bypass);
Expand Down

0 comments on commit 4773ef3

Please sign in to comment.