]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing/probes: Fix to search structure fields correctly
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Sat, 17 Feb 2024 12:25:42 +0000 (21:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:25:05 +0000 (09:25 +0100)
commitd76792931185a2e9628b7bce0bcebdbb14f2dca7
tree6e468374f2eb554be3fd06b3924266b11cab9603
parentebc1972c2c89daa8c8292c7477e38cbf9c27278e
tracing/probes: Fix to search structure fields correctly

commit 9704669c386f9bbfef2e002e7e690c56b7dcf5de upstream.

Fix to search a field from the structure which has anonymous union
correctly.
Since the reference `type` pointer was updated in the loop, the search
loop suddenly aborted where it hits an anonymous union. Thus it can not
find the field after the anonymous union. This avoids updating the
cursor `type` pointer in the loop.

Link: https://lore.kernel.org/all/170791694361.389532.10047514554799419688.stgit@devnote2/
Fixes: 302db0f5b3d8 ("tracing/probes: Add a function to search a member of a struct/union")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_btf.c