diff options
author | Lucy Mielke <[email protected]> | 2023-10-12 12:44:32 +0200 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2023-10-12 20:37:59 +0200 |
commit | ac8b60be078abebc3ab8836f3f0ecac6980e0b4f (patch) | |
tree | 5813336a949675ed3db3ddebc10e5c137bd1034f /tools/perf/scripts/python/sched-migration.py | |
parent | e6115c6f7a0ce3388cc60b69a284facf78b5dbfd (diff) |
locking/lockdep: Fix string sizing bug that triggers a format-truncation compiler-warning
On an allyesconfig, with "treat warnings as errors" unset, GCC emits
these warnings:
kernel/locking/lockdep_proc.c:438:32: Warning: Format specifier '%lld' may
be truncated when writing 1 to 17 bytes into a region
of size 15 [-Wformat-truncation=]
kernel/locking/lockdep_proc.c:438:31: Note: Format directive argument is
in the range [-9223372036854775, 9223372036854775]
kernel/locking/lockdep_proc.c:438:9: Note: 'snprintf' has output
between 5 and 22 bytes into a target of size 15
In seq_time(), the longest s64 is "-9223372036854775808"-ish, which
converted to the fixed-point float format is "-9223372036854775.80": 21 bytes,
plus termination is another byte: 22. Therefore, a larger buffer size
of 22 is needed here - not 15. The code was safe due to the snprintf().
Fix it.
Signed-off-by: Lucy Mielke <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions