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  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]
Date:   Sun, 31 Oct 2021 22:42:14 +0800
From:   Leo Yan <>
To:     Mathieu Poirier <>,
        Suzuki K Poulose <>,
        Mike Leach <>,
        Alexander Shishkin <>,
        James Clark <>,,,
Cc:     Leo Yan <>
Subject: [PATCH v1 4/4] coresight: etm3x: Don't trace contextID for non-root namespace in perf mode

ETMv3 driver doesn't handle the case when programs run in non-root PID
namespace, so it allows the contextID tracing by directly using perf

This patch changes to only enable contextID tracing for root PID
namespace.  Note, the hardware supports VMID tracing from ETMv3.5, but
the driver never enables VMID trace, so this patch doesn't handle VMID
trace (bit 30 in ETMCR register) particularly.

Signed-off-by: Leo Yan <>
 drivers/hwtracing/coresight/coresight-etm3x-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c
index cf64ce73a741..0621ab0c71d9 100644
--- a/drivers/hwtracing/coresight/coresight-etm3x-core.c
+++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c
@@ -340,6 +340,10 @@ static int etm_parse_event_config(struct etm_drvdata *drvdata,
 	config->ctrl = attr->config;
+	/* Don't trace contextID when runs in non-root PID namespace */
+	if (task_active_pid_ns(current) != &init_pid_ns)
+		config->ctrl &= ~ETMCR_CTXID_SIZE;
 	 * Possible to have cores with PTM (supports ret stack) and ETM
 	 * (never has ret stack) on the same SoC. So if we have a request

Powered by blists - more mailing lists