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=-16.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 4F6D6C432BE for ; Tue, 31 Aug 2021 15:03:33 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6035604D7 for ; Tue, 31 Aug 2021 15:03:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B6035604D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=schaufler-ca.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-587-2Xq452mUP8eJRjQJJNwcoQ-1; Tue, 31 Aug 2021 11:03:25 -0400 X-MC-Unique: 2Xq452mUP8eJRjQJJNwcoQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A41D94DD5; Tue, 31 Aug 2021 15:03:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80E6D6B542; Tue, 31 Aug 2021 15:03:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C055E4BB7C; Tue, 31 Aug 2021 15:03:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17VF3Hq8016285 for ; Tue, 31 Aug 2021 11:03:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB9D9114B2F1; Tue, 31 Aug 2021 15:03:17 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6E90114B2EF for ; Tue, 31 Aug 2021 15:03:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5D68811E8D for ; Tue, 31 Aug 2021 15:03:14 +0000 (UTC) Received: from sonic317-38.consmr.mail.ne1.yahoo.com (sonic317-38.consmr.mail.ne1.yahoo.com [66.163.184.49]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-WenlnohaP8ydsjXRoVWk9Q-1; Tue, 31 Aug 2021 11:03:12 -0400 X-MC-Unique: WenlnohaP8ydsjXRoVWk9Q-1 X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1630422191; bh=NOHLz6kK6UgdnKHnssrO1Ti4n/aKd17oBJxmiDCAKiG=; h=X-Sonic-MF:Subject:To:From:Date:From:Subject; b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2jDqoSk120iDosS8nJMq9 EXZYeTzrA9w2EG9XTQcudO7F2DkX.16Stiv4qk52aVE7AGo3o582GiUprUuzRWHXjmUIteeMpydN pK73HcTwCnb9gB96AgvA9cQZT03TU90Xr8nTtK7KClUCkwkpjNMD0sPxbcCnSOhdM1TIt3vQQQqJ HDC2.CKgZLQ6F53XOKB8R3WYCzfFzC63GlscRu78ygST_P7Kwzb4fHW0x992gF3igK2QS6LxPWwQ rmVLHzjaVtdTwgLmNz9bgUyM1WnogL5LuB6nqUPMIeP2A5gpxKMwp6cvQctfXOu75QgDCCf63iH8 iOHL4i7Adcdl38mlb98ifuTxPNq4OcgeTKqkSWtln1h35XgbpG_U4fGr8.Dgfk94CDmTVdYQLt45 wiK46ZdLZ2WHXbqAa4MI9WVoj5dRf2yVDWhfyaAXgmcxjapo6tzEuLksXhn3izCdACB5AOkBABQL TRBn1jDU3.DnIV10vhCRNa.KOlcWwyPBNRJv6CHgTVbafOqWcRWDny.rXpAnW2RedQ1wr2OyvCi6 jh2bV3CkUedTChCjfrBeCehjPeabGPC1b4O6FAx3yulf6J79gRr4ixAQb X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 31 Aug 2021 15:03:11 +0000 Received: by kubenode531.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID edde45835be1392ba24d927ad035bea1; Tue, 31 Aug 2021 15:03:09 +0000 (UTC) Subject: Re: [RFC PATCH v2 9/9] Smack: Brutalist io_uring support with debug To: Paul Moore References: <162871480969.63873.9434591871437326374.stgit@olly> <162871494794.63873.18299137802334845525.stgit@olly> From: Casey Schaufler Message-ID: <50ff8adf-d99c-e9a9-3d8b-cb9c2777455f@schaufler-ca.com> Date: Tue, 31 Aug 2021 08:03:07 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: linux-audit@redhat.com Cc: Jens Axboe , selinux@vger.kernel.org, Pavel Begunkov , linux-security-module@vger.kernel.org, linux-audit@redhat.com, Kumar Kartikeya Dwivedi , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 8/31/2021 7:44 AM, Paul Moore wrote: > On Wed, Aug 11, 2021 at 4:49 PM Paul Moore wrote: >> From: Casey Schaufler >> >> Add Smack privilege checks for io_uring. Use CAP_MAC_OVERRIDE >> for the override_creds case and CAP_MAC_ADMIN for creating a >> polling thread. These choices are based on conjecture regarding >> the intent of the surrounding code. >> >> Signed-off-by: Casey Schaufler >> [PM: make the smack_uring_* funcs static] >> Signed-off-by: Paul Moore >> >> --- >> v2: >> - made the smack_uring_* funcs static >> v1: >> - initial draft >> --- >> security/smack/smack_lsm.c | 64 ++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 64 insertions(+) >> >> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c >> index 223a6da0e6dc..7fb094098f38 100644 >> --- a/security/smack/smack_lsm.c >> +++ b/security/smack/smack_lsm.c >> @@ -4691,6 +4691,66 @@ static int smack_dentry_create_files_as(struct dentry *dentry, int mode, >> return 0; >> } >> >> +#ifdef CONFIG_IO_URING >> +/** >> + * smack_uring_override_creds - Is io_uring cred override allowed? >> + * @new: the target creds >> + * >> + * Check to see if the current task is allowed to override it's credentials >> + * to service an io_uring operation. >> + */ >> +static int smack_uring_override_creds(const struct cred *new) >> +{ >> + struct task_smack *tsp = smack_cred(current_cred()); >> + struct task_smack *nsp = smack_cred(new); >> + >> +#if 1 >> + if (tsp->smk_task == nsp->smk_task) >> + pr_info("%s: Smack matches %s\n", __func__, >> + tsp->smk_task->smk_known); >> + else >> + pr_info("%s: Smack override check %s to %s\n", __func__, >> + tsp->smk_task->smk_known, nsp->smk_task->smk_known); >> +#endif > Casey, with the idea of posting a v3 towards the end of the merge > window next week, without the RFC tag and with the intention of > merging it into -next during the first/second week of the -rcX phase, > do you have any objections to me removing the debug code (#if 1 ... > #endif) from your patch? Did you have any other changes? I have no other changes. And yes, the debug code should be stripped. Thank you. > > > -- > paul moore > www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit