diff options
| author | Beau Belgrave <beaub@linux.microsoft.com> | 2024-04-23 16:23:37 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-12 11:12:11 +0200 |
| commit | 4aa2d5fd7ee090f0605d29a86650defb38162fdd (patch) | |
| tree | ac3ed9b33a339253cdfb82cebef00cb638b54b05 /scripts | |
| parent | 4c40e1b76e6e533235b35f621c02b387d6105bd4 (diff) | |
| download | linux-4aa2d5fd7ee090f0605d29a86650defb38162fdd.tar.gz linux-4aa2d5fd7ee090f0605d29a86650defb38162fdd.tar.bz2 linux-4aa2d5fd7ee090f0605d29a86650defb38162fdd.zip | |
tracing/user_events: Fix non-spaced field matching
[ Upstream commit bd125a084091396f3e796bb3dc009940d9771811 ]
When the ABI was updated to prevent same name w/different args, it
missed an important corner case when fields don't end with a space.
Typically, space is used for fields to help separate them, like
"u8 field1; u8 field2". If no spaces are used, like
"u8 field1;u8 field2", then the parsing works for the first time.
However, the match check fails on a subsequent register, leading to
confusion.
This is because the match check uses argv_split() and assumes that all
fields will be split upon the space. When spaces are used, we get back
{ "u8", "field1;" }, without spaces we get back { "u8", "field1;u8" }.
This causes a mismatch, and the user program gets back -EADDRINUSE.
Add a method to detect this case before calling argv_split(). If found
force a space after the field separator character ';'. This ensures all
cases work properly for matching.
With this fix, the following are all treated as matching:
u8 field1;u8 field2
u8 field1; u8 field2
u8 field1;\tu8 field2
u8 field1;\nu8 field2
Link: https://lore.kernel.org/linux-trace-kernel/20240423162338.292-2-beaub@linux.microsoft.com
Fixes: ba470eebc2f6 ("tracing/user_events: Prevent same name but different args event")
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
