]> git.itanic.dy.fi Git - linux-stable/commit
tracing: Introduce helpers to safely handle dynamic-sized sockaddrs
authorChuck Lever <chuck.lever@oracle.com>
Tue, 11 Jan 2022 17:43:55 +0000 (12:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:36:50 +0000 (17:36 +0100)
commit8c26ecd887eff5dff6e33dea3ba213d10a8095a2
tree4c2fe3175547eb497869d6bf31ec45b04aaeba5b
parent7851771789e87108a92697194105ef0c9307dc5e
tracing: Introduce helpers to safely handle dynamic-sized sockaddrs

[ Upstream commit d07c9ad622474616e94572e59e725c2c4a494fb4 ]

Enable a struct sockaddr to be stored in a trace record as a
dynamically-sized field. The common cases are AF_INET and AF_INET6
which are different sizes, and are vastly smaller than a struct
sockaddr_storage.

These are safer because, when used properly, the size of the
sockaddr destination field in each trace record is now guaranteed
to be the same as the source address that is being copied into it.

Link: https://lore.kernel.org/all/164182978641.8391.8277203495236105391.stgit@bazille.1015granger.net/
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Stable-dep-of: 948f072ada23 ("SUNRPC: always free ctxt when freeing deferred request")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/trace/bpf_probe.h
include/trace/perf.h
include/trace/trace_events.h