]> git.ipfire.org Git - thirdparty/linux.git/commit
rtla: Fix NULL pointer dereference in actions_parse
authorWander Lairson Costa <wander@redhat.com>
Tue, 6 Jan 2026 11:49:48 +0000 (08:49 -0300)
committerTomas Glozar <tglozar@redhat.com>
Wed, 7 Jan 2026 14:57:55 +0000 (15:57 +0100)
commita0890f9dbd24b302d327fe7dad9b9c5be0e278aa
treea2b7aa7389cdce7ed764886858770deb8e6f1c9c
parentf3cc3e4b5116929ebff27c3b0a565b34ae4969b3
rtla: Fix NULL pointer dereference in actions_parse

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>
tools/tracing/rtla/src/actions.c