Skip to content

v0.7.1

Latest

Choose a tag to compare

@github-actions github-actions released this 14 Oct 16:39
· 51 commits to master since this release

wprof v0.7.1

Bug fix and security proofing release.

Security

  • New --seal KIND option. For runners that run wprof with elevated privileges and append arguments from a less trusted user. Each --seal restricts the options that appear after it; options before it are unaffected. It is a hidden option and can be repeated:
    • file-output: reject -D, -T and -J. --seal-output remains as an alias for backwards compat.
    • file-input: reject the @FILE form of -U, -n, -N, --thread-name and --no-thread-name. These read the file with wprof's privileges, and its contents could end up in the capture or in error output.
    • uprobe-args: reject argument capture (arg:...) on u:, uret: and uspan: probes. These probes can still be used without arg:, including with stack and pid:/path:/comm: filters. Argument capture on all other probe types is unaffected.
# Runner-controlled options, then seals, then user-supplied options.
$ sudo wprof --record -D out.data -T out.pb \
             --seal file-output --seal file-input --seal uprobe-args \
             <user options>
  • Stack buffer overflow fixed. A word of 256 or more characters in a -n/-N/--thread-name/--no-thread-name @FILE overflowed a stack buffer and crashed wprof. Linues up to 4095 characters are now read intact; longer ones are split.

PMU Counters

  • AMD event selects above 0xff are programmed correctly. AMD's 12-bit event select was encoded into the wrong bits, so such events silently counted a different event with a corrupted umask. This also affected the kernel's own cpu/ref-cycles/ alias on AMD (event=0x120).
  • PMU fields are encoded from sysfs. pmu/field=value/ specs are now encoded from /sys/bus/event_source/devices/<pmu>/format/, matching perf. Split fields such as amd_df's 14-bit event and 12-bit umask are encoded correctly, and every declared field is accepted (for example amd_l3 threadmask/sliceid and amd_iommu filters). Raw config=, config1= and config2= are combined with other fields as in perf.
  • Stricter validation. A value wider than its field, or a field the PMU doesn't declare, is now an error. As a result, pc= is rejected on AMD, which doesn't declare it.

Full Changelog: v0.7...v0.7.1