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 24E0EC4707F for ; Fri, 21 May 2021 20:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08D2561164 for ; Fri, 21 May 2021 20:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbhEUUVT (ORCPT ); Fri, 21 May 2021 16:21:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230417AbhEUUVE (ORCPT ); Fri, 21 May 2021 16:21:04 -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 1C8F0C061348 for ; Fri, 21 May 2021 13:19:30 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id u21so32160118ejo.13 for ; Fri, 21 May 2021 13:19:30 -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=thIe01+lHwzzxJedNGYnXkOMlihftpqGjXXbGI6UEFA=; b=W+zX4pg+qPV5VVsGwBht13DCLZB6q2mUKw3vLfil5mUEswjFv1dWGsywFmS7Uhiwaf OY8nWzuFL3COW2K+KDmJo+wmSfc7iD4GUN9bLWSMnJW5xM6SlVuCtVwUvwlKmlz5T0ty YksRQKsjYR1UMz/AlMlZ/sz0jauzIecYTsL1pC0us/Ya4PNrNfgoGU8mx/Un9c873cIr AeM0+0cQ2RDqrcouA+tHjxWocqUH62s3o0ySgAVLMu3OIS4NG1xsIfFUUhaHAkjIfuFP 3AMrK51OGTsWYM2SzU0A0u1IdUtNQRpeoC++i1qe+n77FVvd36So0CZHQHQn49Ck2gQ1 hUTA== 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=thIe01+lHwzzxJedNGYnXkOMlihftpqGjXXbGI6UEFA=; b=sQ8Op9jnAj2X1mzcMiVViUv3ArpEFjcMbsu+ZVP50BmMyPXpGF/pY9C7vrBRDG4W5q MTAf2UijxUNaKkoIuJ8ZMT6l4COVD/DYjpzywp665Ha99oZ9xDGoBPQqoIKw0Vd96/YU QuZ7xvW9vHyxvPBfbMqL9dWhURT6dZ8txswN+tNizItg569szPRC+9wunR//uxw8WP0T fmZp3qLsjUw/JCPCV3ejINTE23ktOvxB6lqI187NJzoicErQZmPft6q9qfvBQMFKXAWL p84uQvVr2THtymJXTOU0Pm4w9b4KoCdfUOhaejrBh5BAikXDDZdk03YJm4n7NGZf5uvO sSLw== X-Gm-Message-State: AOAM532dZOw592swpeMfj8qwyFHjMWa0/VWbKGbK8/8L5HaCoJ3jvnFq BbxllRm6F9tqtaPr5CgKXHlvW8BKUhV8He3Auk7b X-Google-Smtp-Source: ABdhPJw0PVE6pZTKuiQy3zYlqq+cxAQrxa/Xganf0agDkuOLzcXPOC4Z4cnZeLkkxqOOBbAnCmgf66QN4Q0jU9XPK1g= X-Received: by 2002:a17:906:840c:: with SMTP id n12mr11897181ejx.431.1621628368643; Fri, 21 May 2021 13:19:28 -0700 (PDT) MIME-Version: 1.0 References: <20210513200807.15910-1-casey@schaufler-ca.com> <20210513200807.15910-16-casey@schaufler-ca.com> In-Reply-To: <20210513200807.15910-16-casey@schaufler-ca.com> From: Paul Moore Date: Fri, 21 May 2021 16:19:17 -0400 Message-ID: Subject: Re: [PATCH v26 15/25] LSM: Ensure the correct LSM context releaser 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, Chuck Lever , linux-integrity@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-nfs@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:24 PM Casey Schaufler wrote: > > Add a new lsmcontext data structure to hold all the information > about a "security context", including the string, its size and > which LSM allocated the string. The allocation information is > necessary because LSMs have different policies regarding the > lifecycle of these strings. SELinux allocates and destroys > them on each use, whereas Smack provides a pointer to an entry > in a list that never goes away. > > Reviewed-by: Kees Cook > Reviewed-by: John Johansen > Acked-by: Stephen Smalley > Acked-by: Chuck Lever > Signed-off-by: Casey Schaufler > Cc: linux-integrity@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: linux-audit@redhat.com > Cc: netfilter-devel@vger.kernel.org > To: Pablo Neira Ayuso > Cc: linux-nfs@vger.kernel.org > --- > drivers/android/binder.c | 10 ++++--- > fs/ceph/xattr.c | 6 ++++- > fs/nfs/nfs4proc.c | 8 ++++-- > fs/nfsd/nfs4xdr.c | 7 +++-- > include/linux/security.h | 35 +++++++++++++++++++++++-- > include/net/scm.h | 5 +++- > kernel/audit.c | 14 +++++++--- > kernel/auditsc.c | 12 ++++++--- > net/ipv4/ip_sockglue.c | 4 ++- > net/netfilter/nf_conntrack_netlink.c | 4 ++- > net/netfilter/nf_conntrack_standalone.c | 4 ++- > net/netfilter/nfnetlink_queue.c | 13 ++++++--- > net/netlabel/netlabel_unlabeled.c | 19 +++++++++++--- > net/netlabel/netlabel_user.c | 4 ++- > security/security.c | 11 ++++---- > 15 files changed, 121 insertions(+), 35 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 286CCC04FF3 for ; Fri, 21 May 2021 20:19:43 +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 ACBB8613E1 for ; Fri, 21 May 2021 20:19:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACBB8613E1 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-366-TtG84H9VPBuRcGJI_XD5NQ-1; Fri, 21 May 2021 16:19:38 -0400 X-MC-Unique: TtG84H9VPBuRcGJI_XD5NQ-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 995FB803627; Fri, 21 May 2021 20:19:34 +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 844035D743; Fri, 21 May 2021 20:19:34 +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 5B54C44A61; Fri, 21 May 2021 20:19:34 +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 14LKJXWL012207 for ; Fri, 21 May 2021 16:19:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BFE520FD566; Fri, 21 May 2021 20:19:33 +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 082F620FD563 for ; Fri, 21 May 2021 20:19:32 +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 45BC18007AC for ; Fri, 21 May 2021 20:19:32 +0000 (UTC) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-556-pZhOYTkwOqqnsGvm9e1BiA-1; Fri, 21 May 2021 16:19:29 -0400 X-MC-Unique: pZhOYTkwOqqnsGvm9e1BiA-1 Received: by mail-ej1-f46.google.com with SMTP id gb17so14191190ejc.8 for ; Fri, 21 May 2021 13:19:29 -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=thIe01+lHwzzxJedNGYnXkOMlihftpqGjXXbGI6UEFA=; b=MMolkznLD0NQVhKJjuWv3KUw+4sGBgQLBL4s67nrbgwXPJL/R9CQIVQtBm/q0fWnlC NM7fof7q/424Dj3Ytrn1LksKghLkkWiv0oyTiL2f8FjdmBv6PbmpCbOkYT4J4dyB8wvS Rm1AvlKO/mFVNeyjIDkcobYt7o5NJ+buxJrmv2e1aChoKESnLH2T2uhonbiTssYaHxNy AUuK2yfeqhlR8wo7o5N1/AZ1WKN/NQxJ3Js2zcLg4/wug7Ko3nFGRxnsMBC3Ol+DVpQz ua8AGqJpvcKB7XalGmJowXzVos4vfYyxve8cIlDgqpCT0BRXxx3/TTfBuOQWFBGdqT0w c19A== X-Gm-Message-State: AOAM530vWsGIECTrm6DgWP6CFtS3rti976Rez1t9k2RXx+/p2iaQb5bB oi1UI+iM0qL7h0dmUmLDKIA9G7aNpCLq+rIyu37F X-Google-Smtp-Source: ABdhPJw0PVE6pZTKuiQy3zYlqq+cxAQrxa/Xganf0agDkuOLzcXPOC4Z4cnZeLkkxqOOBbAnCmgf66QN4Q0jU9XPK1g= X-Received: by 2002:a17:906:840c:: with SMTP id n12mr11897181ejx.431.1621628368643; Fri, 21 May 2021 13:19:28 -0700 (PDT) MIME-Version: 1.0 References: <20210513200807.15910-1-casey@schaufler-ca.com> <20210513200807.15910-16-casey@schaufler-ca.com> In-Reply-To: <20210513200807.15910-16-casey@schaufler-ca.com> From: Paul Moore Date: Fri, 21 May 2021 16:19:17 -0400 Message-ID: Subject: Re: [PATCH v26 15/25] LSM: Ensure the correct LSM context releaser 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.6 X-loop: linux-audit@redhat.com Cc: linux-nfs@vger.kernel.org, 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, Chuck Lever , linux-integrity@vger.kernel.org, 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.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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, May 13, 2021 at 4:24 PM Casey Schaufler wrote: > > Add a new lsmcontext data structure to hold all the information > about a "security context", including the string, its size and > which LSM allocated the string. The allocation information is > necessary because LSMs have different policies regarding the > lifecycle of these strings. SELinux allocates and destroys > them on each use, whereas Smack provides a pointer to an entry > in a list that never goes away. > > Reviewed-by: Kees Cook > Reviewed-by: John Johansen > Acked-by: Stephen Smalley > Acked-by: Chuck Lever > Signed-off-by: Casey Schaufler > Cc: linux-integrity@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: linux-audit@redhat.com > Cc: netfilter-devel@vger.kernel.org > To: Pablo Neira Ayuso > Cc: linux-nfs@vger.kernel.org > --- > drivers/android/binder.c | 10 ++++--- > fs/ceph/xattr.c | 6 ++++- > fs/nfs/nfs4proc.c | 8 ++++-- > fs/nfsd/nfs4xdr.c | 7 +++-- > include/linux/security.h | 35 +++++++++++++++++++++++-- > include/net/scm.h | 5 +++- > kernel/audit.c | 14 +++++++--- > kernel/auditsc.c | 12 ++++++--- > net/ipv4/ip_sockglue.c | 4 ++- > net/netfilter/nf_conntrack_netlink.c | 4 ++- > net/netfilter/nf_conntrack_standalone.c | 4 ++- > net/netfilter/nfnetlink_queue.c | 13 ++++++--- > net/netlabel/netlabel_unlabeled.c | 19 +++++++++++--- > net/netlabel/netlabel_user.c | 4 ++- > security/security.c | 11 ++++---- > 15 files changed, 121 insertions(+), 35 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