diff options
| author | Hangbin Liu <liuhangbin@kylinos.cn> | 2026-11-12 13:46:44 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-16 15:35:01 -0800 |
| commit | 5aac571d919087d766d85729e0b53f41d275eb7b (patch) | |
| tree | 1669333ba508fd84d5776a84aac4eb560a51bb7e /tools/perf/scripts/python/bin | |
| parent | 44a3eee943ad7b899ad590c1e2c73be9deb01e9a (diff) | |
ipv6: ioam6: do not modify shared tuninfo eh.nexthdr
ioam6_do_inline() and ioam6_do_encap() stored the next header into
the shared ilwt->tuninfo template and then memcpy()ed it into the
skb. The lwtstate is used from multiple CPUs without locking, so
another packet can overwrite eh.nexthdr between the store and the
memcpy.
The packet can then leave with an HBH nexthdr that does not match its
payload (e.g. TCP labelled as UDP, or a local packet labelled
IPPROTO_IPV6). Set nexthdr on the per-packet Hop-by-Hop copy after
memcpy instead, leave the shared template read-only.
Mark the tuninfo argument const now that the shared template is no
longer modified, and drop the unnecessary (u8 *) cast in memcpy.
Fixes: 3edede08ff37 ("ipv6: ioam: Support for IOAM injection with lwtunnels")
Fixes: 8cb3bf8bff3c ("ipv6: ioam: Add support for the ip6ip6 encapsulation")
Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
Closes: https://lore.kernel.org/netdev/179336082844.3134.1265197633714491521@kernel.org
Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261112-ipv6_ioam_lock-v4-1-89e3381be525@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
