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,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 83F68C432BE for ; Tue, 31 Aug 2021 14:45:36 +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 07B8060200 for ; Tue, 31 Aug 2021 14:45:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 07B8060200 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.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-601-sNwapOWnOXS0ukPpWDXsYg-1; Tue, 31 Aug 2021 10:45:33 -0400 X-MC-Unique: sNwapOWnOXS0ukPpWDXsYg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C5E31F2DD; Tue, 31 Aug 2021 14:45:29 +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 7891C2C175; Tue, 31 Aug 2021 14:45:28 +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 5B1C04A7C8; Tue, 31 Aug 2021 14:45:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17VEiNxO014929 for ; Tue, 31 Aug 2021 10:44:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B6AE21417D9; Tue, 31 Aug 2021 14:44:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54F63214183E for ; Tue, 31 Aug 2021 14:44:19 +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 91D6680018D for ; Tue, 31 Aug 2021 14:44:19 +0000 (UTC) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-mZPETebLMXa4OlJwJwhI-A-1; Tue, 31 Aug 2021 10:44:17 -0400 X-MC-Unique: mZPETebLMXa4OlJwJwhI-A-1 Received: by mail-ed1-f45.google.com with SMTP id n11so27148075edv.11 for ; Tue, 31 Aug 2021 07:44:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZgczlerqsLLyl2VhT0frihVj435uIvC1cuXaGZGKBOI=; b=bvaPenV2DCIjky54vInxZ5/v8XcQ68UativRTDw9HNqPWr1s24vQ15Jaw/FOR6GzJy YrMOTl2BL3A3iUo6C8WwVrlNUXnEa14nsTDdPMEheCnOzVz/Z/XqxUJ2nzKOoarGesma xOLnagZELWOoGuzSy/uXFrfrpa7ATCw8bD8IynM9pUBm+tTnYtk/Sy8n6UavTuCh/mfx I+xM4hGb+k40O1kYTOV4Me962oQzx7yisrrqHqLCuoltUgLr+BJLJyW/H6vm6RImox2M ZHZptrAi+QaV6caazsL4Nd+SmzCoJoPP5yMcbQS7pRnz8lA1LFVxxkCED3IRs7bWecpQ bSCw== X-Gm-Message-State: AOAM531dzoW78SYBsg34vjHzb2BXSvu2go4caBwD8QtaG1zQOcxuB5ra xZlH9afLmoXA160YmoAa5fhdYPTy8CYHTfsW87JJ X-Google-Smtp-Source: ABdhPJxbttl+pKPJFUUvqGQMjsVPM20zpWUvXsGRTjRdvPPkDxQWNi7BI9HiCjmjrGOfcCWQfO3dlyXR34/S8Enb9H4= X-Received: by 2002:a50:ed09:: with SMTP id j9mr29852978eds.164.1630421056093; Tue, 31 Aug 2021 07:44:16 -0700 (PDT) MIME-Version: 1.0 References: <162871480969.63873.9434591871437326374.stgit@olly> <162871494794.63873.18299137802334845525.stgit@olly> In-Reply-To: <162871494794.63873.18299137802334845525.stgit@olly> From: Paul Moore Date: Tue, 31 Aug 2021 10:44:05 -0400 Message-ID: Subject: Re: [RFC PATCH v2 9/9] Smack: Brutalist io_uring support with debug To: casey@schaufler-ca.com 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.6 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.11 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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? -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit