lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2da60c28dcaecfc2cb7bcd25840ffcbe@codeaurora.org>
Date:   Tue, 02 Mar 2021 12:11:37 +0530
From:   Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>
To:     Doug Anderson <dianders@...omium.org>
Cc:     Mark Rutland <mark.rutland@....com>, Al Grant <al.grant@....com>,
        Denis Nikitin <denik@...omium.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        coresight@...ts.linaro.org,
        Mattias Nissler <mnissler@...omium.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Stephen Boyd <swboyd@...omium.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>, Leo Yan <leo.yan@...aro.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Mike Leach <mike.leach@...aro.org>
Subject: Re: [PATCHv2 3/4] coresight: etm4x: Add support to exclude kernel
 mode tracing

On 2021-03-02 04:13, Doug Anderson wrote:
> Hi,
> 
> On Mon, Mar 1, 2021 at 11:05 AM Sai Prakash Ranjan
> <saiprakash.ranjan@...eaurora.org> wrote:
>> 
>> On production systems with ETMs enabled, it is preferred to exclude
>> kernel mode(NS EL1) tracing for security concerns and support only
>> userspace(NS EL0) tracing. Perf subsystem interface uses the newly
>> introduced kernel config CONFIG_EXCLUDE_KERNEL_PMU_TRACE to exclude
>> kernel mode tracing, but there is an additional interface via sysfs
>> for ETMs which also needs to be handled to exclude kernel
>> mode tracing. So we use this same generic kernel config to handle
>> the sysfs mode of tracing. This config is disabled by default and
>> would not affect the current configuration which has both kernel and
>> userspace tracing enabled by default.
>> 
>> Tested-by: Denis Nikitin <denik@...omium.org>
>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>
>> ---
>>  drivers/hwtracing/coresight/coresight-etm4x-core.c  | 6 +++++-
>>  drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 6 ++++++
>>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> Not that I'm an expert in the perf subsystem, but the concern I had
> with v1 is now addressed.  FWIW this seems fine to me now.
> 
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
> 

Thanks Doug.

> 
>> --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
>> @@ -296,6 +296,12 @@ static ssize_t mode_store(struct device *dev,
>>         if (kstrtoul(buf, 16, &val))
>>                 return -EINVAL;
>> 
>> +       if (IS_ENABLED(CONFIG_EXCLUDE_KERNEL_PMU_TRACE) && (!(val & 
>> ETM_MODE_EXCL_KERN))) {
>> +               dev_warn(dev,
>> +                       "Kernel mode tracing is not allowed, check 
>> your kernel config\n");
> 
> slight nit that I think your string needs to be indented by 1 space.  
> ;-)
> 

Ah yes, I will have to post v3 anyways to fix commit message in Patch 2
after I get few more feedback for other patches, I will fix this up as 
well.

Thanks,
Sai

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member
of Code Aurora Forum, hosted by The Linux Foundation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ