* [PATCH pidfd] signal: Add missing __user annotation to copy_siginfo_from_user_any
@ 2020-12-07 0:02 Jann Horn
2020-12-07 10:32 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Jann Horn @ 2020-12-07 0:02 UTC (permalink / raw)
To: Christian Brauner; +Cc: Oleg Nesterov, Eric W. Biederman, linux-kernel
copy_siginfo_from_user_any() takes a userspace pointer as second
argument; annotate the parameter type accordingly.
Signed-off-by: Jann Horn <jannh@google.com>
---
I'm messing around with clang's version of __user annotation checking
and it spotted this issue:
kernel/signal.c:3759:44: warning: casting to dereferenceable pointer removes 'noderef' attribute [-Wnoderef]
ret = copy_siginfo_from_user_any(&kinfo, info);
^~~~
Untracked cast to function pointer at kernel/signal.c:4294:26
Christian, since this is pidfd code, can you take this through your tree?
Or should I send this to akpm (or someone else)?
kernel/signal.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index ef8f2a28d37c..4693191dc17c 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3685,7 +3685,8 @@ static bool access_pidfd_pidns(struct pid *pid)
return true;
}
-static int copy_siginfo_from_user_any(kernel_siginfo_t *kinfo, siginfo_t *info)
+static int copy_siginfo_from_user_any(kernel_siginfo_t *kinfo,
+ siginfo_t __user *info)
{
#ifdef CONFIG_COMPAT
/*
base-commit: 0477e92881850d44910a7e94fc2c46f96faa131f
--
2.29.2.576.ga3fc446d84-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH pidfd] signal: Add missing __user annotation to copy_siginfo_from_user_any
2020-12-07 0:02 [PATCH pidfd] signal: Add missing __user annotation to copy_siginfo_from_user_any Jann Horn
@ 2020-12-07 10:32 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2020-12-07 10:32 UTC (permalink / raw)
To: Jann Horn; +Cc: Oleg Nesterov, Eric W. Biederman, linux-kernel
On Mon, Dec 07, 2020 at 01:02:52AM +0100, Jann Horn wrote:
> copy_siginfo_from_user_any() takes a userspace pointer as second
> argument; annotate the parameter type accordingly.
>
> Signed-off-by: Jann Horn <jannh@google.com>
> ---
> I'm messing around with clang's version of __user annotation checking
> and it spotted this issue:
>
> kernel/signal.c:3759:44: warning: casting to dereferenceable pointer removes 'noderef' attribute [-Wnoderef]
> ret = copy_siginfo_from_user_any(&kinfo, info);
> ^~~~
> Untracked cast to function pointer at kernel/signal.c:4294:26
>
>
> Christian, since this is pidfd code, can you take this through your tree?
> Or should I send this to akpm (or someone else)?
I'm picking it up now. :) Thanks!
Christian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-07 10:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07 0:02 [PATCH pidfd] signal: Add missing __user annotation to copy_siginfo_from_user_any Jann Horn
2020-12-07 10:32 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox