summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/flamegraph.py
diff options
context:
space:
mode:
authorMelbin K Mathew <mlbnkm1@gmail.com>2026-07-02 01:42:46 +0200
committerHelge Deller <deller@gmx.de>2026-08-08 08:08:58 +0200
commitd15d51fb26e830af58f3f21964f1c09c239077ea (patch)
tree531cd5c2d0dfce25186e977350bbfd67b1eccc53 /tools/perf/scripts/python/flamegraph.py
parent075b74841bd0065a3bda3440873c747938e69b68 (diff)
fbdev: bound mode sysfs output to the sysfs buffer
mode_string() uses snprintf() which can return a value larger than the remaining buffer space. show_modes() accumulates the return value into i without checking whether i has reached PAGE_SIZE, causing the offset to advance past the sysfs buffer if the modelist is long enough. Add a size parameter to mode_string() and use scnprintf() to return only the bytes actually written. Add an early return when offset already exceeds the buffer. In show_modes(), stop accumulating once the buffer is full. Cc: stable@vger.kernel.org # v7.1+ Signed-off-by: Melbin K Mathew <mlbnkm1@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions