Skip to content

Commit 7bb82ac

Browse files
tklausertorvalds
authored andcommitted
ftrace: let ftrace_enable_sysctl take a kernel pointer buffer
Commit 3292739 ("sysctl: pass kernel pointers to ->proc_handler") changed ctl_table.proc_handler to take a kernel pointer. Adjust the signature of ftrace_enable_sysctl to match ctl_table.proc_handler which fixes the following sparse warning: kernel/trace/ftrace.c:7544:43: warning: incorrect type in argument 3 (different address spaces) kernel/trace/ftrace.c:7544:43: expected void * kernel/trace/ftrace.c:7544:43: got void [noderef] __user *buffer Fixes: 3292739 ("sysctl: pass kernel pointers to ->proc_handler") Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Link: https://lkml.kernel.org/r/20200907093207.13540-1-tklauser@distanz.ch Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9683182 commit 7bb82ac

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎include/linux/ftrace.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ static inline int ftrace_mod_get_kallsym(unsigned int symnum, unsigned long *val
8585
extern int ftrace_enabled;
8686
extern int
8787
ftrace_enable_sysctl(struct ctl_table *table, int write,
88-
void __user *buffer, size_t *lenp,
89-
loff_t *ppos);
88+
void *buffer, size_t *lenp, loff_t *ppos);
9089

9190
struct ftrace_ops;
9291

‎kernel/trace/ftrace.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7531,8 +7531,7 @@ static bool is_permanent_ops_registered(void)
75317531

75327532
int
75337533
ftrace_enable_sysctl(struct ctl_table *table, int write,
7534-
void __user *buffer, size_t *lenp,
7535-
loff_t *ppos)
7534+
void *buffer, size_t *lenp, loff_t *ppos)
75367535
{
75377536
int ret = -ENODEV;
75387537

0 commit comments

Comments
 (0)