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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  4 Aug 2023 16:15:13 +0800
From:   Ruidong Tian <tianruidong@...ux.alibaba.com>
To:     linux-kernel@...r.kernel.org
Cc:     tianruidong@...ux.alibaba.com, alexander.shishkin@...ux.intel.com,
        coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
        mike.leach@...aro.org, suzuki.poulose@....com, james.clark@....com
Subject: [PATCH v3 0/1] coresight: tmc: Explicit type conversions to

Perf cs_etm session executed unexpectedly when AUX buffer > 1G.

  perf record -C 0 -m ,2G -e cs_etm// -- <workload>
  [ perf record: Captured and wrote 2.615 MB perf.data ]

Perf only collect about 2M perf data rather than 2G. This is becasuse
the operation, "nr_pages << PAGE_SHIFT", in coresight tmc driver, will
overflow when nr_pages >= 0x80000(correspond to 1G AUX buffer). The
overflow cause buffer allocation to fail, and TMC driver will alloc
minimal buffer size(1M). You can just get about 2M perf data(1M AUX
buffer + perf data header) at least.

Explicit convert nr_pages to 64 bit in tmc driver to avoid overflow.

Changes in V2:
Suzuki K Poulose:
    Add another 2 places where needed to fix.

Changes in V1:
James Clark:
    Use a more accurate commit message.

Ruidong Tian (1):
  coresight: tmc: Explicit type conversions to prevent integer overflow

 drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +-
 drivers/hwtracing/coresight/coresight-tmc-etr.c | 5 +++--
 drivers/hwtracing/coresight/coresight-tmc.h     | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.33.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ