From ba3fa6e8c1eb4e40719451710263c87fb5f22221 Mon Sep 17 00:00:00 2001 From: Gal Pressman Date: Wed, 19 Feb 2025 16:32:55 +0200 Subject: ip_tunnel: Use ip_tunnel_info() helper instead of 'info + 1' Tunnel options should not be accessed directly, use the ip_tunnel_info() accessor instead. Signed-off-by: Gal Pressman Reviewed-by: Kees Cook Link: https://patch.msgid.link/20250219143256.370277-2-gal@nvidia.com Signed-off-by: Jakub Kicinski --- include/net/ip_tunnels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 1aa31bdb2b31..7b54cea5de27 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -650,7 +650,7 @@ static inline void iptunnel_xmit_stats(struct net_device *dev, int pkt_len) static inline void ip_tunnel_info_opts_get(void *to, const struct ip_tunnel_info *info) { - memcpy(to, info + 1, info->options_len); + memcpy(to, ip_tunnel_info_opts(info), info->options_len); } static inline void ip_tunnel_info_opts_set(struct ip_tunnel_info *info, -- cgit v1.2.3