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,URIBL_BLOCKED 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 878EBC433E0 for ; Wed, 10 Mar 2021 00:23:49 +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-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4B8365009 for ; Wed, 10 Mar 2021 00:23:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4B8365009 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-601-aaTwM9OpNm6bYLdrbboGMA-1; Tue, 09 Mar 2021 19:23:45 -0500 X-MC-Unique: aaTwM9OpNm6bYLdrbboGMA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C009801503; Wed, 10 Mar 2021 00:23:42 +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 EA5E519C46; Wed, 10 Mar 2021 00:23:41 +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 770034EA48; Wed, 10 Mar 2021 00:23:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12A0NcFw016842 for ; Tue, 9 Mar 2021 19:23:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id D4F9D208C17A; Wed, 10 Mar 2021 00:23:38 +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 D02702026D46 for ; Wed, 10 Mar 2021 00:23:36 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4597E855203 for ; Wed, 10 Mar 2021 00:23:36 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-167-2rv0Za9AN82XH4pWvkfkBA-1; Tue, 09 Mar 2021 19:23:33 -0500 X-MC-Unique: 2rv0Za9AN82XH4pWvkfkBA-1 Received: by mail-ej1-f44.google.com with SMTP id p8so33347046ejb.10 for ; Tue, 09 Mar 2021 16:23: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=mGJKH5Nan57Lb0mYe8qLU+a35AfEmCmHaoAdvSVrNjs=; b=YuPydpzZPLFWl7tSc7DrZHbpQuTu3Z16/mdqwYIm4yHaZoCjbAA+EyvfzV8Lad4aWT eNKjyPc3cOzphwGxzZKlQT/qJTCmduRyxC6BGwc/2UKOrCBU5+mZdtAXDh317PP7xk2h BLGqkpiILNtSRe1cKliEuVNEJ+7JgC95gq/67sKpGcNy/M3D48ie6bCY0VhaitYMeyU6 HHOhXnPZXCfwX8k2xqKs21+r5mVKZ6GdVViMHhNhkliSp1NddWfAoIc9dgYm5nxYdQka 9ivgRH2NN/3YXxbQB04gHheFkouY8DocXrphiIxfOnJ/yRNyZGZHk8AwtuyoVhgovqET oG5A== X-Gm-Message-State: AOAM532PS1oVUyYdxZRP1V46O+NEmhtLp40vCHctUgc+/hQnzPrlGDzi Wg4LMz9jQgr1jSDDo1zJJVB37hl0Hat/hLfMSUn6 X-Google-Smtp-Source: ABdhPJwewkchC/561Qkcxt5+GUOEDDdtdYmovXavaPjjsS4wklRjuMtlYLZeVhTPRiH1C9bajE5N7jzr553wewMP674= X-Received: by 2002:a17:906:2314:: with SMTP id l20mr717555eja.178.1615335812584; Tue, 09 Mar 2021 16:23:32 -0800 (PST) MIME-Version: 1.0 References: <161377712068.87807.12246856567527156637.stgit@sifl> <161377734508.87807.8537642254664217815.stgit@sifl> <20210308192529.GY2015948@madcap2.tricolour.ca> In-Reply-To: <20210308192529.GY2015948@madcap2.tricolour.ca> From: Paul Moore Date: Tue, 9 Mar 2021 19:23:21 -0500 Message-ID: Subject: Re: [RFC PATCH 1/4] lsm: separate security_task_getsecid() into subjective and objective variants To: Richard Guy Briggs 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.4 X-loop: linux-audit@redhat.com Cc: selinux@vger.kernel.org, linux-security-module@vger.kernel.org, John Johansen , 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.84 on 10.5.11.23 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 Mon, Mar 8, 2021 at 2:25 PM Richard Guy Briggs wrote: > On 2021-02-19 18:29, 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 > > Audit: Acked-by: Richard Guy Briggs > Reviewed-by: Richard Guy Briggs Thanks Richard, I added your review tag to the LSM, SELinux, and Smack patches. -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit