]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtla: Replace magic number with MAX_PATH
authorWander Lairson Costa <wander@redhat.com>
Mon, 9 Mar 2026 19:46:18 +0000 (16:46 -0300)
committerTomas Glozar <tglozar@redhat.com>
Tue, 10 Mar 2026 09:32:37 +0000 (10:32 +0100)
commita29430c2bc86b00e62f74299b866216390c7e418
treec8c3da30c9f01cdcd60d50f11eeeb6a60c5f2892
parenta50c53884db83189947f213d4c7f8385c522d141
rtla: Replace magic number with MAX_PATH

The trace functions use a buffer to manipulate strings that will be
written to tracefs files. These buffers are defined with a magic number
of 1024, which is a common source of vulnerabilities.

Replace the magic number 1024 with the MAX_PATH macro to make the code
safer and more readable. While at it, replace other instances of the
magic number with ARRAY_SIZE() when the buffer is locally defined.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260309195040.1019085-6-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/src/osnoise.c
tools/tracing/rtla/src/timerlat_u.c
tools/tracing/rtla/src/trace.c