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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, 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 A2D89C433E0 for ; Thu, 11 Mar 2021 01:55:52 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B839C64DD1 for ; Thu, 11 Mar 2021 01:55:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B839C64DD1 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=linux-audit-bounces@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-72-DUy0OFxcMTaM2-9w8Kqqdg-1; Wed, 10 Mar 2021 20:55:49 -0500 X-MC-Unique: DUy0OFxcMTaM2-9w8Kqqdg-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 7820A80432D; Thu, 11 Mar 2021 01:55:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7324059453; Thu, 11 Mar 2021 01:55:43 +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 93A8F1809C86; Thu, 11 Mar 2021 01:55:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12B1tcrc006751 for ; Wed, 10 Mar 2021 20:55:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id AACA67D546; Thu, 11 Mar 2021 01:55:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4CC183B99 for ; Thu, 11 Mar 2021 01:55:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6AD4E800C5B for ; Thu, 11 Mar 2021 01:55:36 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488--cAGguZgOu-hIrzCn3wcSQ-1; Wed, 10 Mar 2021 20:55:34 -0500 X-MC-Unique: -cAGguZgOu-hIrzCn3wcSQ-1 Received: by mail-ej1-f50.google.com with SMTP id jt13so42982416ejb.0 for ; Wed, 10 Mar 2021 17:55:33 -0800 (PST) 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=Ypaibdj5e3KXs0JU5bHysEKmmO+AWX8qecTeOE2LAd0=; b=G+zQDZYe/QhOumOPlPMS+R88hsS14SyzvvCi5qf6a9fdERgICFQ56klMaL5QXf0B9E T/pU3nFtl2OuQvDVjbnW8ZfW8FYP4Ubdg4WZBf+b2n5AcUDEpo8z1aijQkbSD0F9+1z0 hKvxfKdRwLo/iw1rALZR5QGmL8jei4kk3NjHEYdHzGvFboQLxQUIuWX7FFAmDR5NQt// 1B2aThLHUduB0H0nxlk36I1e6jprzVp26Rm3AXyI3S1K7P6xqCNSAcNgVLIvXjFLbXes grT4myo8WnjWy6v1KnxxdPz+wk/H4V57ysSpNA8GdoOnoL9V6PTMjP/EbxJG8FI+wSgd AJWA== X-Gm-Message-State: AOAM531oWzjjv5C0W8Cbe22exAAv6iOS1pofz1iGT5D1pOY+MTKHfjUh a8DOGawAOMG8o9BxM7m/w20LzrTLr+9GZlikL3BT X-Google-Smtp-Source: ABdhPJwhgpk+Bqtj76Jv2/UFtXcPG6p4xzvX2zWBO561yrSUVSlX73taqpcNagxjLeBsuDUe0Xy8Jefb88aN5kND5Rc= X-Received: by 2002:a17:906:3d62:: with SMTP id r2mr726523ejf.488.1615427732811; Wed, 10 Mar 2021 17:55:32 -0800 (PST) MIME-Version: 1.0 References: <161377712068.87807.12246856567527156637.stgit@sifl> <161377734508.87807.8537642254664217815.stgit@sifl> In-Reply-To: From: Paul Moore Date: Wed, 10 Mar 2021 20:55:21 -0500 Message-ID: Subject: Re: [RFC PATCH 1/4] lsm: separate security_task_getsecid() into subjective and objective variants To: John Johansen 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.79 on 10.11.54.5 X-loop: linux-audit@redhat.com Cc: selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-audit@redhat.com 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 Tue, Mar 9, 2021 at 8:03 PM John Johansen wrote: > On 2/19/21 3:29 PM, Paul Moore wrote: > > Of the three LSMs that implement the security_task_getsecid() LSM > > hook, all three LSMs provide the task's objective security > > credentials. This turns out to be unfortunate as most of the hook's > > callers seem to expect the task's subjective credentials, although > > a small handful of callers do correctly expect the objective > > credentials. > > > > This patch is the first step towards fixing the problem: it splits > > the existing security_task_getsecid() hook into two variants, one > > for the subjective creds, one for the objective creds. > > > > void security_task_getsecid_subj(struct task_struct *p, > > u32 *secid); > > void security_task_getsecid_obj(struct task_struct *p, > > u32 *secid); > > > > While this patch does fix all of the callers to use the correct > > variant, in order to keep this patch focused on the callers and to > > ease review, the LSMs continue to use the same implementation for > > both hooks. The net effect is that this patch should not change > > the behavior of the kernel in any way, it will be up to the latter > > LSM specific patches in this series to change the hook > > implementations and return the correct credentials. > > > > Signed-off-by: Paul Moore > > Reviewed-by: John Johansen Thanks John, I know you're swamped these days. -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit