lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210315132103.129386-1-linux@fw-web.de>
Date:   Mon, 15 Mar 2021 14:21:03 +0100
From:   Frank Wunderlich <linux@...web.de>
To:     "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Frank Wunderlich <frank-w@...lic-files.de>
Subject: [PATCH] net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4

From: Frank Wunderlich <frank-w@...lic-files.de>

commit 2019554f9656 introduces implementation of icmp{,v6}_ndo_send in
include/linux/icmp{,v6}.h in case of NF_NAT is enabled. Now these
functions are defined twice in wireguard. Fix this by hiding code if
NF_NAT is set (reverse condition as in icmp*.h)

././net/wireguard/compat/compat.h:959:20: error: static declaration of 'icmp_ndo_send' follows non-static declaration
  959 | static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
./include/net/icmp.h:47:6: note: previous declaration of 'icmp_ndo_send' was here
   47 | void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info);
././net/wireguard/compat/compat.h:988:20: error: static declaration of 'icmpv6_ndo_send' follows non-static declaration
  988 | static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info)
./include/linux/icmpv6.h:56:6: note: previous declaration of 'icmpv6_ndo_send' was here
   56 | void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info);

Fixes: 2019554f9656 ("icmp: introduce helper for nat'd source address in network device context")
Signed-off-by: Frank Wunderlich <frank-w@...lic-files.de>
---
 net/wireguard/compat/compat.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/wireguard/compat/compat.h b/net/wireguard/compat/compat.h
index 42f7beecaa5c..7cdb0b253c60 100644
--- a/net/wireguard/compat/compat.h
+++ b/net/wireguard/compat/compat.h
@@ -956,6 +956,7 @@ static inline int skb_ensure_writable(struct sk_buff *skb, int write_len)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
 #include <net/netfilter/nf_nat_core.h>
 #endif
+#if !IS_ENABLED(CONFIG_NF_NAT)
 static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
 {
 	struct sk_buff *cloned_skb = NULL;
@@ -1014,6 +1015,7 @@ static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u
 out:
 	consume_skb(cloned_skb);
 }
+#endif
 #else
 #define icmp_ndo_send icmp_send
 #define icmpv6_ndo_send icmpv6_send
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ