summaryrefslogtreecommitdiff
path: root/include/linux/kobject_api.h
diff options
context:
space:
mode:
authorBeau Belgrave <beaub@linux.microsoft.com>2024-04-23 16:23:37 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 09:49:49 +0200
commit366bff10bb6ce0d633afbddb827d52c87160de8a (patch)
treef6ecd9ef25c627df82095a5e5960b71fd3b9ab2e /include/linux/kobject_api.h
parentc7e9debced5c02c62217005ca3acd346a199e223 (diff)
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 'include/linux/kobject_api.h')
0 files changed, 0 insertions, 0 deletions