From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6623EC433FE for ; Mon, 7 Dec 2020 13:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CB0F23406 for ; Mon, 7 Dec 2020 13:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726083AbgLGNFf (ORCPT ); Mon, 7 Dec 2020 08:05:35 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:34206 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgLGNFe (ORCPT ); Mon, 7 Dec 2020 08:05:34 -0500 Received: from ip5f5af0a0.dynamic.kabel-deutschland.de ([95.90.240.160] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kmGCB-00065A-87; Mon, 07 Dec 2020 13:04:51 +0000 Date: Mon, 7 Dec 2020 14:04:49 +0100 From: Christian Brauner To: Lukas Bulwahn Cc: Christian Brauner , linux-kernel@vger.kernel.org, Tycho Andersen , Kees Cook , David Howells , Arnd Bergmann , Thomas Gleixner , Serge Hallyn , Aleksa Sarai , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] signal: propagate __user annotations properly Message-ID: <20201207130449.nbt23aholqebbvux@wittgenstein> References: <20201207123610.18246-1-lukas.bulwahn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201207123610.18246-1-lukas.bulwahn@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 01:36:10PM +0100, Lukas Bulwahn wrote: > 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 > --- > applies cleanly on current master (v5.10-rc7) and next-20201204 > > Christian, please pick this minor non-urgent clean-up patch. Thanks for the patch. Unfortunately I already picked up Jann's patch who sent it yesterday or this morning: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/?h=pidfd Thanks! Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Brauner Date: Mon, 07 Dec 2020 13:04:49 +0000 Subject: Re: [PATCH] signal: propagate __user annotations properly Message-Id: <20201207130449.nbt23aholqebbvux@wittgenstein> List-Id: References: <20201207123610.18246-1-lukas.bulwahn@gmail.com> In-Reply-To: <20201207123610.18246-1-lukas.bulwahn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Lukas Bulwahn Cc: Christian Brauner , linux-kernel@vger.kernel.org, Tycho Andersen , Kees Cook , David Howells , Arnd Bergmann , Thomas Gleixner , Serge Hallyn , Aleksa Sarai , kernel-janitors@vger.kernel.org On Mon, Dec 07, 2020 at 01:36:10PM +0100, Lukas Bulwahn wrote: > 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 > --- > applies cleanly on current master (v5.10-rc7) and next-20201204 > > Christian, please pick this minor non-urgent clean-up patch. Thanks for the patch. Unfortunately I already picked up Jann's patch who sent it yesterday or this morning: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/?h=pidfd Thanks! Christian