Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp573849pxj; Fri, 7 May 2021 15:19:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0psaBS5Ce5fW3YvoSQ8iOgMtMNRsqkj03+0xStb9zUDbaPsFskBlZG9wQjr4dNleo9U4Z X-Received: by 2002:a65:620d:: with SMTP id d13mr12199585pgv.85.1620425949602; Fri, 07 May 2021 15:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620425949; cv=none; d=google.com; s=arc-20160816; b=0KC7YU01nkoDvLm7u9DdJuriXYAjOqlCe4rjbe+I8f0WriQDt6tUgv1igOCGIUfRpH Y0Wc8vgBRpfl6c0Cx+lwl/Hflc7KySkgeN4Hvp5M/Uty7iRZ+cbXFhI/aBCl+26tqae/ lJypgIf9Z9f+bKzY06oVajEqHSuQCSn6Ni3Xp9zYudqCavFlltfNkCeBiIQMV4qFgDSI 3DY5i/KKtpLFtYLDgzXU9AMTvUL3gRNWp42QElTN6OzX9LxS2IgVtJHhVWBGaJMwKoDH yu31oEZZZuRolwavgdoW5VSWDy58rHIHiqvxoEk8+zFYM42MIoqVX3iXqgdw2384Lrkm DSFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=+yQyyY7zclHTIByQYNIWTbhh35GfbYJfYE6s5N9CmTs=; b=JMbVeF60szw61k31Q7ocXuAEy+/tkK7GvorBWLrM+QVIFHcdQFbIIO1ALI+eF953dL yQVzZ1gFxPEh567yA+ZFjgK9B4kdoILkuFhzKoZdPZDfGiwpsz29DAHWcEqVp7fteq3P E+7Zx1kb2+u1vJIR/yl1MkaEpVbFddizHG4IYjdtU8MJ7hdmqqE0Pq5isDmBHMm/sT4+ 58XgbmbtuNHaMwT2rHLQ8S2lAmyISicee6y/u8EdtiKDQNEJ8xH3+bw21fFNNDL+vzEx k0M7QmIYjuRB1Wp67SC0LGt3g3lU7r9KfShzTPU7gyKodGtQ7N96rQEHa6VHQ8uhDZPK 8N5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="N/eZloie"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si8508278plj.248.2021.05.07.15.18.55; Fri, 07 May 2021 15:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="N/eZloie"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbhEGWSP (ORCPT + 99 others); Fri, 7 May 2021 18:18:15 -0400 Received: from sonic317-39.consmr.mail.ne1.yahoo.com ([66.163.184.50]:42970 "EHLO sonic317-39.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhEGWSM (ORCPT ); Fri, 7 May 2021 18:18:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1620425831; bh=+yQyyY7zclHTIByQYNIWTbhh35GfbYJfYE6s5N9CmTs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject:Reply-To; b=N/eZloie9OT6lcNUUv6AXxxIaGm8Y6m6aDNLPfPNsmllblo7x/WOithSwFS2YeBh1WZ5bBAy/g1OlhcLAzGtmKww3FU5CmSznhn1yYJg+gQuz4nWfIZanoT2fwrQ7tVlPyzFj0kLCJLWFgzd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r7QWKTd.ARPLxiniGze5YEWZTNM0Iv55CkRcor5F7v_J_x6H5gZZDs4BqIk.1y5i6iWwEi_S ro2EYYKd9SAmxMD6UuvHSB6JkTsAaR90GHC5Nv5YACT2CSJ.XOKqaJUUkBpk_AttdcSkWtOl4Z2A loAqUJj8ozioO1MHF78HqQZB8D.D_s4M6QD8KXBfUhCS1LwQOy9Da_G6osLNuvYBPMQATaKBJ7AK .4ID7dLZnmQMMl.ngWMjSrrbbLx_pjvB52FErbCn0MOPVDvKfvE08RyI6XWinffAsK7taZ95Cam3 n.kKAwPRUZkMIccAxUGZuO33kdpsJr1feqP3w7iLjzIq5g39L6PUvAl9iT76PKtTiynexcvp02.w iCN6d7bFfQXYkMEAW8T07o04oDJmEtXxUYyB3PTaLgmxGmPepuynY8CBieV5yeFdhnoKk.wVrZ_F 1vvox4mt5m3IlXVbRCIWfN4sRa3FCnJ7vTgmRjW7AM8TsbtC1sQHV6qATpyrE6JcBqR12QHcGz.7 gaKQuhraE9kQ5gB.YIziYG_aTdj02sN6fl5Vq6e.xlWQ18UZJpNxPIuASW2GXQ34qxfR.F.5JSGD S8ZioeHuVl1ZIlF5E1qRxGcFhjXe1zTav0OHLJ.KpSn2rbqq2JZtTsLMuEW2dM1UE0azatu7YbC4 SDU63R1uCDptTcDFkPJAXLPAYD6jie2_jEq35CEbmHlx6xlAVTt4Pj7V1elnkzQCNcZjJBxEMFYT rDTl9PankJzh6oq5tKc9.Vy7Wn8nMW4fF5o8IEVIWkK3BFkChB7VpkE5qizzIWeYIjJiYk5fyutx GXaypF3OC3u5b X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Fri, 7 May 2021 22:17:11 +0000 Received: by kubenode565.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d3800c9c0d52f5633b28fe4b012b96e7; Fri, 07 May 2021 22:17:09 +0000 (UTC) Subject: Re: [PATCH] lockdown,selinux: fix bogus SELinux lockdown permission checks To: Ondrej Mosnacek , linux-security-module@vger.kernel.org, James Morris Cc: Steven Rostedt , Ingo Molnar , Stephen Smalley , selinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Casey Schaufler References: <20210507114048.138933-1-omosnace@redhat.com> From: Casey Schaufler Message-ID: Date: Fri, 7 May 2021 15:17:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210507114048.138933-1-omosnace@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Mailer: WebService/1.1.18295 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/16) Content-Length: 9433 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/2021 4:40 AM, Ondrej Mosnacek wrote: > Commit 59438b46471a ("security,lockdown,selinux: implement SELinux > lockdown") added an implementation of the locked_down LSM hook to > SELinux, with the aim to restrict which domains are allowed to perform > operations that would breach lockdown. > > However, in several places the security_locked_down() hook is called in= > situations where the current task isn't doing any action that would > directly breach lockdown, leading to SELinux checks that are basically > bogus. > > Since in most of these situations converting the callers such that > security_locked_down() is called in a context where the current task > would be meaningful for SELinux is impossible or very non-trivial (and > could lead to TOCTOU issues for the classic Lockdown LSM > implementation), fix this by adding a separate hook > security_locked_down_globally() This is a poor solution to the stated problem. Rather than adding a new hook you should add the task as a parameter to the existing hook and let the security modules do as they will based on its value. If the caller does not have an appropriate task it should pass NULL. The lockdown LSM can ignore the task value and SELinux can make its own decision based on the task value passed. > that is to be used in such situations > and convert all these problematic callers to call this hook instead. Th= e > new hook is then left unimplemented in SELinux and in Lockdown LSM it i= s > backed by the same implementation as the locked_down hook. > > The callers migrated to the new hook are: > 1. arch/powerpc/xmon/xmon.c > Here the hook seems to be called from non-task context and is only= > used for redacting some sensitive values from output sent to > userspace. > 2. fs/tracefs/inode.c:tracefs_create_file() > Here the call is used to prevent creating new tracefs entries when= > the kernel is locked down. Assumes that locking down is one-way - > i.e. if the hook returns non-zero once, it will never return zero > again, thus no point in creating these files. > 3. kernel/trace/bpf_trace.c:bpf_probe_read_kernel{,_str}_common() > Called when a BPF program calls a helper that could leak kernel > memory. The task context is not relevant here, since the program > may very well be run in the context of a different task than the > consumer of the data. > See: https://bugzilla.redhat.com/show_bug.cgi?id=3D1955585 > 4. net/xfrm/xfrm_user.c:copy_to_user_*() > Here a cryptographic secret is redacted based on the value returne= d > from the hook. There are two possible actions that may lead here: > a) A netlink message XFRM_MSG_GETSA with NLM_F_DUMP set - here the= > task context is relevant, since the dumped data is sent back to= > the current task. > b) When deleting an SA via XFRM_MSG_DELSA, the dumped SAs are > broadcasted to tasks subscribed to XFRM events - here the > SELinux check is not meningful as the current task's creds do > not represent the tasks that could potentially see the secret. > It really doesn't seem worth it to try to preserve the check in th= e > a) case, since the eventual leak can be circumvented anyway via b)= , > plus there is no way for the task to indicate that it doesn't care= > about the actual key value, so the check could generate a lot of > noise. > > Fixes: 59438b46471a ("security,lockdown,selinux: implement SELinux lock= down") > Signed-off-by: Ondrej Mosnacek > --- > arch/powerpc/xmon/xmon.c | 4 ++-- > fs/tracefs/inode.c | 2 +- > include/linux/lsm_hook_defs.h | 1 + > include/linux/security.h | 5 +++++ > kernel/trace/bpf_trace.c | 4 ++-- > net/xfrm/xfrm_user.c | 2 +- > security/lockdown/lockdown.c | 1 + > security/security.c | 6 ++++++ > 8 files changed, 19 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c > index 3fe37495f63d..a4bad825d424 100644 > --- a/arch/powerpc/xmon/xmon.c > +++ b/arch/powerpc/xmon/xmon.c > @@ -298,7 +298,7 @@ static bool xmon_is_locked_down(void) > static bool lockdown; > =20 > if (!lockdown) { > - lockdown =3D !!security_locked_down(LOCKDOWN_XMON_RW); > + lockdown =3D !!security_locked_down_globally(LOCKDOWN_XMON_RW); > if (lockdown) { > printf("xmon: Disabled due to kernel lockdown\n"); > xmon_is_ro =3D true; > @@ -306,7 +306,7 @@ static bool xmon_is_locked_down(void) > } > =20 > if (!xmon_is_ro) { > - xmon_is_ro =3D !!security_locked_down(LOCKDOWN_XMON_WR); > + xmon_is_ro =3D !!security_locked_down_globally(LOCKDOWN_XMON_WR); > if (xmon_is_ro) > printf("xmon: Read-only due to kernel lockdown\n"); > } > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > index 4b83cbded559..07241435efec 100644 > --- a/fs/tracefs/inode.c > +++ b/fs/tracefs/inode.c > @@ -396,7 +396,7 @@ struct dentry *tracefs_create_file(const char *name= , umode_t mode, > struct dentry *dentry; > struct inode *inode; > =20 > - if (security_locked_down(LOCKDOWN_TRACEFS)) > + if (security_locked_down_globally(LOCKDOWN_TRACEFS)) > return NULL; > =20 > if (!(mode & S_IFMT)) > diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_def= s.h > index 477a597db013..d6e2a6b59277 100644 > --- a/include/linux/lsm_hook_defs.h > +++ b/include/linux/lsm_hook_defs.h > @@ -390,6 +390,7 @@ LSM_HOOK(void, LSM_RET_VOID, bpf_prog_free_security= , struct bpf_prog_aux *aux) > #endif /* CONFIG_BPF_SYSCALL */ > =20 > LSM_HOOK(int, 0, locked_down, enum lockdown_reason what) > +LSM_HOOK(int, 0, locked_down_globally, enum lockdown_reason what) > =20 > #ifdef CONFIG_PERF_EVENTS > LSM_HOOK(int, 0, perf_event_open, struct perf_event_attr *attr, int ty= pe) > diff --git a/include/linux/security.h b/include/linux/security.h > index 8aeebd6646dc..e683dee84f46 100644 > --- a/include/linux/security.h > +++ b/include/linux/security.h > @@ -468,6 +468,7 @@ int security_inode_notifysecctx(struct inode *inode= , void *ctx, u32 ctxlen); > int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctx= len); > int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctx= len); > int security_locked_down(enum lockdown_reason what); > +int security_locked_down_globally(enum lockdown_reason what); > #else /* CONFIG_SECURITY */ > =20 > static inline int call_blocking_lsm_notifier(enum lsm_event event, voi= d *data) > @@ -1329,6 +1330,10 @@ static inline int security_locked_down(enum lock= down_reason what) > { > return 0; > } > +static inline int security_locked_down_globally(enum lockdown_reason w= hat) > +{ > + return 0; > +} > #endif /* CONFIG_SECURITY */ > =20 > #if defined(CONFIG_SECURITY) && defined(CONFIG_WATCH_QUEUE) > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c > index b0c45d923f0f..f43bca95b261 100644 > --- a/kernel/trace/bpf_trace.c > +++ b/kernel/trace/bpf_trace.c > @@ -215,7 +215,7 @@ const struct bpf_func_proto bpf_probe_read_user_str= _proto =3D { > static __always_inline int > bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_p= tr) > { > - int ret =3D security_locked_down(LOCKDOWN_BPF_READ); > + int ret =3D security_locked_down_globally(LOCKDOWN_BPF_READ); > =20 > if (unlikely(ret < 0)) > goto fail; > @@ -246,7 +246,7 @@ const struct bpf_func_proto bpf_probe_read_kernel_p= roto =3D { > static __always_inline int > bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsa= fe_ptr) > { > - int ret =3D security_locked_down(LOCKDOWN_BPF_READ); > + int ret =3D security_locked_down_globally(LOCKDOWN_BPF_READ); > =20 > if (unlikely(ret < 0)) > goto fail; > diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c > index 5a0ef4361e43..5a56f74262d8 100644 > --- a/net/xfrm/xfrm_user.c > +++ b/net/xfrm/xfrm_user.c > @@ -851,7 +851,7 @@ static int copy_user_offload(struct xfrm_state_offl= oad *xso, struct sk_buff *skb > static bool xfrm_redact(void) > { > return IS_ENABLED(CONFIG_SECURITY) && > - security_locked_down(LOCKDOWN_XFRM_SECRET); > + security_locked_down_globally(LOCKDOWN_XFRM_SECRET); > } > =20 > static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_bu= ff *skb) > diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.= c > index 87cbdc64d272..4ac172eaa4b7 100644 > --- a/security/lockdown/lockdown.c > +++ b/security/lockdown/lockdown.c > @@ -73,6 +73,7 @@ static int lockdown_is_locked_down(enum lockdown_reas= on what) > =20 > static struct security_hook_list lockdown_hooks[] __lsm_ro_after_init = =3D { > LSM_HOOK_INIT(locked_down, lockdown_is_locked_down), > + LSM_HOOK_INIT(locked_down_globally, lockdown_is_locked_down), > }; > =20 > static int __init lockdown_lsm_init(void) > diff --git a/security/security.c b/security/security.c > index 5ac96b16f8fa..b9b990681ae9 100644 > --- a/security/security.c > +++ b/security/security.c > @@ -2547,6 +2547,12 @@ int security_locked_down(enum lockdown_reason wh= at) > } > EXPORT_SYMBOL(security_locked_down); > =20 > +int security_locked_down_globally(enum lockdown_reason what) > +{ > + return call_int_hook(locked_down_globally, 0, what); > +} > +EXPORT_SYMBOL(security_locked_down_globally); > + > #ifdef CONFIG_PERF_EVENTS > int security_perf_event_open(struct perf_event_attr *attr, int type) > {