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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 8FF1CC433E6 for ; Tue, 5 Jan 2021 07:58:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A6C122257 for ; Tue, 5 Jan 2021 07:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727335AbhAEH6P (ORCPT ); Tue, 5 Jan 2021 02:58:15 -0500 Received: from verein.lst.de ([213.95.11.211]:60425 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727271AbhAEH6P (ORCPT ); Tue, 5 Jan 2021 02:58:15 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 441A467373; Tue, 5 Jan 2021 08:57:32 +0100 (CET) Date: Tue, 5 Jan 2021 08:57:31 +0100 From: Christoph Hellwig To: "Eric W. Biederman" Cc: Tetsuo Handa , Al Viro , Jens Axboe , Christoph Hellwig , Kees Cook , LKML Subject: Re: Does uaccess_kernel() work for detecting kernel thread? Message-ID: <20210105075731.GB30414@lst.de> References: <0bcc0c63-31a3-26fd-bccb-b28af0375c34@i-love.sakura.ne.jp> <87a6u5iw3d.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a6u5iw3d.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 11:33:58AM -0600, Eric W. Biederman wrote: > I do wonder though if perhaps we should create a is_user_cred helper to > detect the difference between the creds of kernel threads and the thread > of ordinary userspace. Which would handle io_uring that copy creds > around and check them at a later time more cleanly. I don't think we should as no one has a business to check this difference. If there is a case where the creds are not correct for all access decisions we need to fix that rather than adding hacks.