Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4438420pxf; Tue, 16 Mar 2021 13:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJpo3qCQ0FOQyKHyGf2Il2ynttMlFyjh5obuxXjnWpYo7VMV6MfphHxi74ZPtUYfceB3a2 X-Received: by 2002:a17:906:d790:: with SMTP id pj16mr31244002ejb.255.1615926708271; Tue, 16 Mar 2021 13:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615926708; cv=none; d=google.com; s=arc-20160816; b=tUfk7UxwJNDyC4hTryTLvimGnAvi/+0JGV8VyZ80QwjcHpo/pg2tkpOFtoa1GHnISI O8yYecOJSmGysBo8ouaBv67UjLXr8RmDkUYqAxuInbATQycCzE6WbeaTlTnMI8KyeBB7 6P6HqhligQQ+zD3mG5+BsZgSx6WxDnH1E2q146P+K02sMlCwytfkKFdFFYfDVyhQZs86 AmWmCio2Q2PlywxXSsrLx9xHA210iaZdNJ8rrquuEVNGtmQoqVNxDmDB8pQlm9pn5e6W GPqExjO6euQ0NqdNT5HoKl3aruMLXVsrleX3sbaqTgNGiQmT2jhcucTnbOT/ENRbLwj9 Rkhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I83FUX8REQnGGM5/pjTJyS9wyrS41rYMBqxzXfh8ivs=; b=zOeT66elR6Jz9o0B2xGQ2OblbUeDY215b0sx87uTd2HIgaiXJA2yt8ZaDOMbWhZ57n +QVXRBNfnTHIcsTRtzrVSzUi9k8hj7oSd1M8nXguohGdrbb0kRcw0J+13F1IE0XbL23z tbhTHI/9GiIJ+1VZ6teurMyEVVppDG35C23BG33naHRSPeRUfjXjrLEq1uiqZJkzxzxc sQs/gcNF2kG4/a8kYUs7Hnss3zqkc0rBmpkDFXeNc8KaTyzn8w9qA4RwtmS/bXkvYZz/ dvC1XQmkNr+MDJc5TCsfhEa/fbspKRajYGFHI2/9c0aTkzooXAazfUDQWank+3vAb5kj WX8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="Ryq2S/TC"; 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 eb10si14656584ejc.273.2021.03.16.13.31.26; Tue, 16 Mar 2021 13:31:48 -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=@infradead.org header.s=casper.20170209 header.b="Ryq2S/TC"; 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 S236478AbhCPObN (ORCPT + 99 others); Tue, 16 Mar 2021 10:31:13 -0400 Received: from casper.infradead.org ([90.155.50.34]:34450 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236532AbhCPObG (ORCPT ); Tue, 16 Mar 2021 10:31:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=I83FUX8REQnGGM5/pjTJyS9wyrS41rYMBqxzXfh8ivs=; b=Ryq2S/TCnJe/6qxTbp2Pv+nD43 Svhcv9AsmtreQyXy+cwpkLiuVfs+GZZcAM/wkick+giUJ6YA+EYDURY9jcyZiLZnqfz/NFzH0R9np 3darK4QSLHeIn5OXlBBPCP1VKbDWHx2HzDboiiy+hLUu/Dd431GOeK0EpzfyCYVlC2BBVLBrvm4kU C4RBvJZjFHKibjAYEozTrisNtU3zxZqiUGD6ZGfAom96dfSy7qPYyo/H9O3enKHyKmZSyD4inmsoE jH2NaVKykdggfGBizY4EIZBLpAVanJgxZP/wtosDiwQDb4dq3BwgY0HETFW1LdS53hEuMEcnsm5aJ /C4lphKg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lMAid-000BDy-HS; Tue, 16 Mar 2021 14:30:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 85D353012DF; Tue, 16 Mar 2021 15:30:46 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4E48F2CE947F3; Tue, 16 Mar 2021 15:30:46 +0100 (CET) Date: Tue, 16 Mar 2021 15:30:46 +0100 From: Peter Zijlstra To: Paul Moore Cc: Ondrej Mosnacek , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , selinux@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , Matthew Garrett Subject: Re: [PATCH] perf/core: fix unconditional security_locked_down() call Message-ID: References: <20210224215628.192519-1-omosnace@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 09:53:21AM -0400, Paul Moore wrote: > On Wed, Feb 24, 2021 at 4:59 PM Ondrej Mosnacek wrote: > > > > Currently, the lockdown state is queried unconditionally, even though > > its result is used only if the PERF_SAMPLE_REGS_INTR bit is set in > > attr.sample_type. While that doesn't matter in case of the Lockdown LSM, > > it causes trouble with the SELinux's lockdown hook implementation. > > > > SELinux implements the locked_down hook with a check whether the current > > task's type has the corresponding "lockdown" class permission > > ("integrity" or "confidentiality") allowed in the policy. This means > > that calling the hook when the access control decision would be ignored > > generates a bogus permission check and audit record. > > > > Fix this by checking sample_type first and only calling the hook when > > its result would be honored. > > > > Fixes: b0c8fdc7fdb7 ("lockdown: Lock down perf when in confidentiality mode") > > Signed-off-by: Ondrej Mosnacek > > --- > > kernel/events/core.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > Perf/core folks, do you want to pull this in via your tree? If I > don't hear anything in the next day I'll pull this in via the > selinux/next tree. > > Reviewed-by: Paul Moore Ah, fell in the cracks... I've no idea what Changelog is trying to tell me. It is pure gibberish to me. But the patch seems harmless enough to me. Let me queue it then.