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-next>] [day] [month] [year] [list]
Date:   Mon,  7 Dec 2020 13:36:10 +0100
From:   Lukas Bulwahn <lukas.bulwahn@...il.com>
To:     Christian Brauner <christian@...uner.io>,
        linux-kernel@...r.kernel.org
Cc:     Tycho Andersen <tycho@...ho.ws>, Kees Cook <keescook@...omium.org>,
        David Howells <dhowells@...hat.com>,
        Arnd Bergmann <arnd@...db.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Serge Hallyn <serge@...lyn.com>,
        Aleksa Sarai <cyphar@...har.com>,
        kernel-janitors@...r.kernel.org,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH] signal: propagate __user annotations properly

Commit 3eb39f47934f ("signal: add pidfd_send_signal() syscall") introduced
copy_siginfo_from_user_any(), but missed to add the __user annotation to
the user pointer that is passed as second argument.

Hence, when copy_siginfo_from_user_any() calls copy_siginfo_from_user(),
sparse warns:

  kernel/signal.c:3716:46: warning: incorrect type in argument 2 (different address spaces)
  kernel/signal.c:3716:46:    expected struct siginfo const [noderef] [usertype] __user *from
  kernel/signal.c:3716:46:    got struct siginfo [usertype] *info

And when pidfd_send_signal() calls copy_siginfo_from_user_any(), sparse
warns as well:

  kernel/signal.c:3776:58: warning: incorrect type in argument 2 (different address spaces)
  kernel/signal.c:3776:58:    expected struct siginfo [usertype] *info
  kernel/signal.c:3776:58:    got struct siginfo [noderef] [usertype] __user *info

Add the __user annotation to repair this chain of propagating __user
annotations.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
---
applies cleanly on current master (v5.10-rc7) and next-20201204

Christian, please pick this minor non-urgent clean-up patch.

 kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 5736c55aaa1a..e969b3bc815f 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3701,7 +3701,7 @@ 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
 	/*
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ