umber-kernel/tools/tracing
Wander Lairson Costa 2727242973 rtla: Fix NULL pointer dereference in actions_parse
[ Upstream commit a0890f9dbd24b302d327fe7dad9b9c5be0e278aa ]

The actions_parse() function uses strtok() to tokenize the trigger
string, but does not check if the returned token is NULL before
passing it to strcmp(). If the trigger parameter is an empty string
or contains only delimiter characters, strtok() returns NULL, causing
strcmp() to dereference a NULL pointer and crash the program.

This issue can be triggered by malformed user input or edge cases in
trigger string parsing. Add a NULL check immediately after the strtok()
call to validate that a token was successfully extracted before using
it. If no token is found, the function now returns -1 to indicate a
parsing error.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260106133655.249887-13-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:20:13 -05:00
..
latency tracing/tools: Fix incorrcet short option in usage text for --threads 2025-11-07 07:59:37 -05:00
rtla rtla: Fix NULL pointer dereference in actions_parse 2026-03-04 07:20:13 -05:00
Makefile tools/tracing: Update Makefile to build rtla 2022-01-27 19:15:47 -05:00