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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 31B57C433E0 for ; Mon, 1 Feb 2021 13:42:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D02BA64E7A for ; Mon, 1 Feb 2021 13:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231750AbhBANmf (ORCPT ); Mon, 1 Feb 2021 08:42:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbhBANmd (ORCPT ); Mon, 1 Feb 2021 08:42:33 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C235C061573; Mon, 1 Feb 2021 05:41:53 -0800 (PST) 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=bU766lYCXPgOdHHgx/QYfVKqikbkYZZcWgGhL3Pb1pE=; b=o5dzoXGjMNCKadF6L6XQEABvMM vPZMGfD2U4PeWVkwI7Gmh2s1Y+yEMC4BO889J/d6NzzAnOMaBMpHAARXn4HGuOxcwCGWAVlTfqy/x 2ZZE+1XisVt8Y6qiWJvRNtV7FRv+dX8cfrJBqg1hlrmY3Nbj1Hir9uRsThfJPCSzAs+VoUadXvh/3 Xj5XlSP2Ga01nuyPokdLmQxW+FpiP5nv21/Utfba96pB7BL7FWSgtjH39sY/dYxatpOTJRX0P9/kK uSW/sp+VQktT0fMBRQo2XrTS0L+NxWqgNI9HEVWSrPOQU02DHr7ONWgD3NPWdrxIMDRQ28lKWtqMK lSQfjwFA==; 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 1l6ZSQ-00Dpfr-4B; Mon, 01 Feb 2021 13:41:34 +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 3E47F3003D8; Mon, 1 Feb 2021 14:41:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 21B3C20C8E303; Mon, 1 Feb 2021 14:41:33 +0100 (CET) Date: Mon, 1 Feb 2021 14:41:33 +0100 From: Peter Zijlstra To: Sai Prakash Ranjan Cc: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Leo Yan , coresight@lists.linaro.org, Stephen Boyd , Denis Nikitin , Mattias Nissler , Al Grant , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jannh@google.com Subject: Re: [PATCH 1/4] perf/core: Add support to exclude kernel mode instruction tracing Message-ID: References: <89c7ff59d887a0360434e607bd625393ec3190e5.1611909025.git.saiprakash.ranjan@codeaurora.org> <20210129193040.GJ8912@worktop.programming.kicks-ass.net> <3c96026b544c2244e57b46119427b8a0@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c96026b544c2244e57b46119427b8a0@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Feb 01, 2021 at 01:11:04PM +0530, Sai Prakash Ranjan wrote: > Ok I suppose you mean CONFIG_SECURITY_LOCKDOWN_LSM? But I don't see > how this new config has to depend on that? This can work independently > whether complete lockdown is enforced or not since it applies to only > hardware instruction tracing. Ideally this depends on several hardware > tracing configs such as ETMs and others but we don't need them because > we are already exposing PERF_PMU_CAP_ITRACE check in the events core. If you don't have lockdown, root pretty much owns the kernel, or am I missing something? > be used for some speculative execution based attacks. Which other > kernel level PMUs can be used to get a full branch trace that is not > locked down? If there is one, then this should probably be applied to > it as well. Just the regular counters. The information isn't as accurate, but given enough goes you can infer plenty. Just like all the SMT size-channel attacks. Sure, PT and friends make it even easier, but I don't see a fundamental distinction. 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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 F3AC7C433E0 for ; Mon, 1 Feb 2021 13:42:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 989A664E2C for ; Mon, 1 Feb 2021 13:42:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 989A664E2C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A4QUcOtBl3oxLFgLaH4UT10uM65uzaBprfKVoj0ARIg=; b=N5G4Z7gp8SEPNjXuVheW9PYpv D9d2cAo8/tYFUgI4HJgbrK0tuTEXfdlmNEcyru1RyXIKI/EbBnZ+oI80LzJOArtuyJARXdyy2A/iE Z9rBYDKSYXQwnYR12t25QvFCz3YP72hzimxHnkPEQaiZ7tbVYu3Ztbg1O4AEBJyScsTg4evhPDCFd JJqlYLlynuqx1LqNuZrQ2/I08Xy/9OPzNEzPPaJoh3t0TWurDyXuDsGlqJlmbIRsqMok3GGVUBDQu yJ2rqGsjPbm6FpbQqvAuGpeE8N1BN9fz7++LjBdZjTZ9xhwejO2o4MDUsC5zZKzT0aJMFwhWGfJLs N0BHRCX5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6ZSV-0001lr-Pe; Mon, 01 Feb 2021 13:41:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6ZST-0001lX-D3 for linux-arm-kernel@merlin.infradead.org; Mon, 01 Feb 2021 13:41:37 +0000 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=bU766lYCXPgOdHHgx/QYfVKqikbkYZZcWgGhL3Pb1pE=; b=o5dzoXGjMNCKadF6L6XQEABvMM vPZMGfD2U4PeWVkwI7Gmh2s1Y+yEMC4BO889J/d6NzzAnOMaBMpHAARXn4HGuOxcwCGWAVlTfqy/x 2ZZE+1XisVt8Y6qiWJvRNtV7FRv+dX8cfrJBqg1hlrmY3Nbj1Hir9uRsThfJPCSzAs+VoUadXvh/3 Xj5XlSP2Ga01nuyPokdLmQxW+FpiP5nv21/Utfba96pB7BL7FWSgtjH39sY/dYxatpOTJRX0P9/kK uSW/sp+VQktT0fMBRQo2XrTS0L+NxWqgNI9HEVWSrPOQU02DHr7ONWgD3NPWdrxIMDRQ28lKWtqMK lSQfjwFA==; 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 1l6ZSQ-00Dpfr-4B; Mon, 01 Feb 2021 13:41:34 +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 3E47F3003D8; Mon, 1 Feb 2021 14:41:33 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 21B3C20C8E303; Mon, 1 Feb 2021 14:41:33 +0100 (CET) Date: Mon, 1 Feb 2021 14:41:33 +0100 From: Peter Zijlstra To: Sai Prakash Ranjan Subject: Re: [PATCH 1/4] perf/core: Add support to exclude kernel mode instruction tracing Message-ID: References: <89c7ff59d887a0360434e607bd625393ec3190e5.1611909025.git.saiprakash.ranjan@codeaurora.org> <20210129193040.GJ8912@worktop.programming.kicks-ass.net> <3c96026b544c2244e57b46119427b8a0@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3c96026b544c2244e57b46119427b8a0@codeaurora.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Al Grant , Denis Nikitin , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , linux-arm-msm@vger.kernel.org, coresight@lists.linaro.org, Mattias Nissler , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Stephen Boyd , Ingo Molnar , Leo Yan , Namhyung Kim , jannh@google.com, Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 01, 2021 at 01:11:04PM +0530, Sai Prakash Ranjan wrote: > Ok I suppose you mean CONFIG_SECURITY_LOCKDOWN_LSM? But I don't see > how this new config has to depend on that? This can work independently > whether complete lockdown is enforced or not since it applies to only > hardware instruction tracing. Ideally this depends on several hardware > tracing configs such as ETMs and others but we don't need them because > we are already exposing PERF_PMU_CAP_ITRACE check in the events core. If you don't have lockdown, root pretty much owns the kernel, or am I missing something? > be used for some speculative execution based attacks. Which other > kernel level PMUs can be used to get a full branch trace that is not > locked down? If there is one, then this should probably be applied to > it as well. Just the regular counters. The information isn't as accurate, but given enough goes you can infer plenty. Just like all the SMT size-channel attacks. Sure, PT and friends make it even easier, but I don't see a fundamental distinction. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel