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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 96D3AC4707A for ; Fri, 21 May 2021 20:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 793D1613E1 for ; Fri, 21 May 2021 20:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbhEUUUC (ORCPT ); Fri, 21 May 2021 16:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbhEUUTy (ORCPT ); Fri, 21 May 2021 16:19:54 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65110C06138B for ; Fri, 21 May 2021 13:18:29 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id c20so32268289ejm.3 for ; Fri, 21 May 2021 13:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5nlgh0TQ54JfISjNkuE+6vXCbSzvDn6Db13HObefQGo=; b=VXlAiKygqHU4e+y2w1wYEVp8ltO11dQD7mS0i7xMktZsZBOh7IjbrnQlFEHrZgLBPt LPPPjKQMK/I6M3Ex7YXV46hB5k15+DVlVHJufjK14ZdmI1A14k2vnsERbsWl1JamCaFB BV4HyiVHXHnpCjNocTuao5uTcLbVmP7CWfFvYvYHgys3TZo6Iz/6XstxrABVGgjool74 2dWU/ilFlcQyXkAXGk9Ta9rB916XDVMw4jU+SiXe/EREXBkEd1W0kq6t4u62HHAJtIbO CKMdGPRrSXZNDhkqDJ2Yegsc5YAn3DfPywaDJPGx2psFOqbvrlhyZjzKr66M6y7OF238 ZVNA== 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=5nlgh0TQ54JfISjNkuE+6vXCbSzvDn6Db13HObefQGo=; b=RldtZskeHdnjC9hYEQ5W7cfP7N1UaTbIufgO/2W7WcTuRCeR7uc26g1GAdqqXpKpr8 JGe81EmA7VYao6NmBrm2k2MNLfULVmI+FKjd3OtxAOmLQezovf1diEpmIkux1pHwodzW T9d93HFi75AqPriecRipxt5ldVusQlMxXHjuTazzi8sZ8wU9uVeBdqZJLO2cMMze2Alc a1gtPR+CONJFSKn22LaYOUOzQTORLFhlJbkPHcrQZcniyiDjHQRGyRhYcHQ6gHCXpYeV Pf9gyLquVuv4+NUoTMFXL5HjGN8g9hgo02QV6cdZypCTY68oC182yZr0d6+5ugbWs+47 PbWA== X-Gm-Message-State: AOAM53183i+hOMgxqwe+BiCSIVyYgvcBnxe62DBnSd1cSHLRuhlpAzKA dm7q3swqapGHKsOiolqUtGpOHgRH4CBSQtScG+VX X-Google-Smtp-Source: ABdhPJyuyS2L6lmTp+jUY7WZYbtb0aAruf3WAqiCiM7sDpi5Jow+cezV/k6G8N/8ymdaUuX65MmhhvE9Q5v4Z/UQj8A= X-Received: by 2002:a17:906:9e21:: with SMTP id fp33mr11995874ejc.488.1621628307963; Fri, 21 May 2021 13:18:27 -0700 (PDT) MIME-Version: 1.0 References: <20210513200807.15910-1-casey@schaufler-ca.com> <20210513200807.15910-9-casey@schaufler-ca.com> In-Reply-To: <20210513200807.15910-9-casey@schaufler-ca.com> From: Paul Moore Date: Fri, 21 May 2021 16:18:16 -0400 Message-ID: Subject: Re: [PATCH v26 08/25] LSM: Use lsmblob in security_secid_to_secctx To: Casey Schaufler Cc: casey.schaufler@intel.com, James Morris , linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-audit@redhat.com, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, Stephen Smalley , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 4:17 PM Casey Schaufler wrote: > > Change security_secid_to_secctx() to take a lsmblob as input > instead of a u32 secid. It will then call the LSM hooks > using the lsmblob element allocated for that module. The > callers have been updated as well. This allows for the > possibility that more than one module may be called upon > to translate a secid to a string, as can occur in the > audit code. > > Signed-off-by: Casey Schaufler > Cc: netdev@vger.kernel.org > Cc: linux-audit@redhat.com > Cc: netfilter-devel@vger.kernel.org > To: Pablo Neira Ayuso > To: Paul Moore > --- > drivers/android/binder.c | 12 +++++++++- > include/linux/security.h | 5 +++-- > include/net/scm.h | 7 +++++- > kernel/audit.c | 20 +++++++++++++++-- > kernel/auditsc.c | 28 +++++++++++++++++++---- > net/ipv4/ip_sockglue.c | 4 +++- > net/netfilter/nf_conntrack_netlink.c | 14 ++++++++++-- > net/netfilter/nf_conntrack_standalone.c | 4 +++- > net/netfilter/nfnetlink_queue.c | 11 +++++++-- > net/netlabel/netlabel_unlabeled.c | 30 +++++++++++++++++++++---- > net/netlabel/netlabel_user.c | 6 ++--- > security/security.c | 11 +++++---- > 12 files changed, 123 insertions(+), 29 deletions(-) Acked-by: Paul Moore -- paul moore www.paul-moore.com 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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 0F9BDC04FF3 for ; Fri, 21 May 2021 20:18:55 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FA1D613E1 for ; Fri, 21 May 2021 20:18:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FA1D613E1 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-414-ebzmS4LLMqedh1_a0A2leg-1; Fri, 21 May 2021 16:18:51 -0400 X-MC-Unique: ebzmS4LLMqedh1_a0A2leg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64EDB1854E21; Fri, 21 May 2021 20:18:48 +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 5279B60DCD; Fri, 21 May 2021 20:18:48 +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 208E1180B463; Fri, 21 May 2021 20:18:48 +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 14LKIYu3011987 for ; Fri, 21 May 2021 16:18:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A9A62039D39; Fri, 21 May 2021 20:18:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75A3D2034274 for ; Fri, 21 May 2021 20:18:31 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C6E41825064 for ; Fri, 21 May 2021 20:18:31 +0000 (UTC) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-2jIHSAOpNj69p_3X-6F4Qg-1; Fri, 21 May 2021 16:18:29 -0400 X-MC-Unique: 2jIHSAOpNj69p_3X-6F4Qg-1 Received: by mail-ej1-f43.google.com with SMTP id u21so32156877ejo.13 for ; Fri, 21 May 2021 13:18:28 -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=5nlgh0TQ54JfISjNkuE+6vXCbSzvDn6Db13HObefQGo=; b=jvQRYUOYRDDHvfl4fKXLxdFg/ABKmHriaKX/aNfUmpjTdDQ2npvQoeyJbTyX3JqxVk ucRatpRii4koFZVox4QOLImhCd6uDjTCXUwI+YUpsFQFgJDbegkKsCuaziUkbmAPLLXH TYnxJqyxVpEl75Z4wE3i8wEJ/kGlVU/+N891J1ULvPT/RwMLzvUJbxPRQLjEeUUQglKn a9KgBCyoTc0E9nopPHZXeYQOsD2SmbTCBO2HDXr8Wl07CJ6Y5eqb39a7grM6Z6/EgESX +eQJ2QZjF82evDd2lN9gCuo0xgQ/rX+1ZASO8jqDYbWmUj7h6KL46xlanJVVYrK0EEHy ivZg== X-Gm-Message-State: AOAM532uwKE7JnODkctxOwNlZT9JlUlS6QYRNSd3G3xaZCNsXOtr7z5Q o90XanShz7JcSpnXpb6zgfNxZPJxl/E3mtS+ZLwA X-Google-Smtp-Source: ABdhPJyuyS2L6lmTp+jUY7WZYbtb0aAruf3WAqiCiM7sDpi5Jow+cezV/k6G8N/8ymdaUuX65MmhhvE9Q5v4Z/UQj8A= X-Received: by 2002:a17:906:9e21:: with SMTP id fp33mr11995874ejc.488.1621628307963; Fri, 21 May 2021 13:18:27 -0700 (PDT) MIME-Version: 1.0 References: <20210513200807.15910-1-casey@schaufler-ca.com> <20210513200807.15910-9-casey@schaufler-ca.com> In-Reply-To: <20210513200807.15910-9-casey@schaufler-ca.com> From: Paul Moore Date: Fri, 21 May 2021 16:18:16 -0400 Message-ID: Subject: Re: [PATCH v26 08/25] LSM: Use lsmblob in security_secid_to_secctx To: Casey Schaufler 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: john.johansen@canonical.com, selinux@vger.kernel.org, netdev@vger.kernel.org, James Morris , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-audit@redhat.com, netfilter-devel@vger.kernel.org, casey.schaufler@intel.com, Stephen Smalley 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.13 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 Thu, May 13, 2021 at 4:17 PM Casey Schaufler wrote: > > Change security_secid_to_secctx() to take a lsmblob as input > instead of a u32 secid. It will then call the LSM hooks > using the lsmblob element allocated for that module. The > callers have been updated as well. This allows for the > possibility that more than one module may be called upon > to translate a secid to a string, as can occur in the > audit code. > > Signed-off-by: Casey Schaufler > Cc: netdev@vger.kernel.org > Cc: linux-audit@redhat.com > Cc: netfilter-devel@vger.kernel.org > To: Pablo Neira Ayuso > To: Paul Moore > --- > drivers/android/binder.c | 12 +++++++++- > include/linux/security.h | 5 +++-- > include/net/scm.h | 7 +++++- > kernel/audit.c | 20 +++++++++++++++-- > kernel/auditsc.c | 28 +++++++++++++++++++---- > net/ipv4/ip_sockglue.c | 4 +++- > net/netfilter/nf_conntrack_netlink.c | 14 ++++++++++-- > net/netfilter/nf_conntrack_standalone.c | 4 +++- > net/netfilter/nfnetlink_queue.c | 11 +++++++-- > net/netlabel/netlabel_unlabeled.c | 30 +++++++++++++++++++++---- > net/netlabel/netlabel_user.c | 6 ++--- > security/security.c | 11 +++++---- > 12 files changed, 123 insertions(+), 29 deletions(-) Acked-by: Paul Moore -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit