Netfilter fixes for net
Subsystems (3)
Pablo Neira Ayuso
maintainercover Netfilter fixes for net
Hi,
The following patchset contains Netfilter fixes for net:
1) Uninitialized when used in __nf_conntrack_update(), from Nathan Chancellor.
2) Comparison of unsigned expression in nf_confirm_cthelper().
3) Remove 'const' type qualifier with no effect.
This batch is addressing fallout from the previous pull request.
Please, pull this updates from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thank you.
----------------------------------------------------------------
The following changes since commit a4976a3ef844c510ae9120290b23e9f3f47d6bce:
crypto: chelsio/chtls: properly set tp->lsndtime (2020-05-26 23:24:00 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to 4946ea5c1237036155c3b3a24f049fd5f849f8f6:
netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build (2020-05-27 13:39:08 +0200)
----------------------------------------------------------------
Nathan Chancellor (1):
netfilter: conntrack: Pass value of ctinfo to __nf_conntrack_update
Pablo Neira Ayuso (2):
netfilter: conntrack: comparison of unsigned in cthelper confirmation
netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build
include/linux/netfilter/nf_conntrack_pptp.h | 2 +- net/netfilter/nf_conntrack_core.c | 8 ++++---- net/netfilter/nf_conntrack_pptp.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
Pablo Neira Ayuso
maintainerPATCH 1/3 netfilter: conntrack: Pass value of ctinfo to __nf_conntrack_update
From: Nathan Chancellor <[email protected]>
Clang warns:
net/netfilter/nf_conntrack_core.c:2068:21: warning: variable 'ctinfo' is uninitialized when used here [-Wuninitialized]
nf_ct_set(skb, ct, ctinfo);
^~~~~~
net/netfilter/nf_conntrack_core.c:2024:2: note: variable 'ctinfo' is
declared here
enum ip_conntrack_info ctinfo;
^1 warning generated.
nf_conntrack_update was split up into nf_conntrack_update and __nf_conntrack_update, where the assignment of ctinfo is in nf_conntrack_update but it is used in __nf_conntrack_update.
Pass the value of ctinfo from nf_conntrack_update to __nf_conntrack_update so that uninitialized memory is not used and everything works properly.
--- net/netfilter/nf_conntrack_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_core.c +3 -3
@@ -2017,11 +2017,11 @@ static void nf_conntrack_attach(struct sk_buff *nskb, const struct sk_buff *skb) }static int __nf_conntrack_update (struct net *net,struct sk_buff *skb, -struct nf_conn *ct) +struct nf_conn *ct, +enum ip_conntrack_info ctinfo) {struct nf_conntrack_tuple_hash *h;struct nf_conntrack_tuple tuple; -enum ip_conntrack_info ctinfo;struct nf_nat_hook *nat_hook;unsigned int status;int dataoff;
@@ -2146,7 +2146,7 @@ static int nf_conntrack_update(struct net *net, struct sk_buff *skb)return 0 ;if (!nf_ct_is_confirmed (ct)) { - err =__nf_conntrack_update (net, skb, ct); + err =__nf_conntrack_update (net, skb, ct, ctinfo);if (err <0 )return err; }
Signature · 1 line
2.20.1
Pablo Neira Ayuso
maintainerPATCH 2/3 netfilter: conntrack: comparison of unsigned in cthelper confirmation
In reply to Pablo Neira Ayusonet/netfilter/nf_conntrack_core.c: In function nf_confirm_cthelper:net/netfilter/nf_conntrack_core.c:2117:15: warning: comparison of unsigned expression in < 0 is always false [-Wtype-limits]
2117 | if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
| ^
ipv6_skip_exthdr() returns a signed integer.
--- net/netfilter/nf_conntrack_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_core.c +1 -1
@@ -2092,7 +2092,7 @@ static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct, {const struct nf_conntrack_helper *helper;const struct nf_conn_help *help; -unsigned int protoff; +int protoff; help =nfct_help (ct);if (!help)
Signature · 1 line
2.20.1
Pablo Neira Ayuso
maintainerPATCH 3/3 netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build
In reply to Pablo Neira AyusoQuoted 1 line
Quoted 1 line
include/linux/netfilter/nf_conntrack_pptp.h:13:20: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
extern const char *const pptp_msg_name(u_int16_t msg); ^~~~~~
--- include/linux/netfilter/nf_conntrack_pptp.h | 2 +- net/netfilter/nf_conntrack_pptp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/netfilter/nf_conntrack_pptp.h +1 -1
@@ -10,7 +10,7 @@#include <net/netfilter/nf_conntrack_expect.h> #include <uapi/linux/netfilter/nf_conntrack_tuple_common.h> -extern const char *const pptp_msg_name (u_int16_t msg); +const char *pptp_msg_name (u_int16_t msg);/* state of the control session */ enum pptp_ctrlsess_state {
net/netfilter/nf_conntrack_pptp.c +1 -1
@@ -91,7 +91,7 @@ static const char *const pptp_msg_name_array[PPTP_MSG_MAX + 1] = { [PPTP_SET_LINK_INFO] = "SET_LINK_INFO" }; -const char *const pptp_msg_name (u_int16_t msg) +const char *pptp_msg_name (u_int16_t msg) {if (msg >PPTP_MSG_MAX )return pptp_msg_name_array[0 ];
Signature · 1 line
2.20.1
David Miller
maintainerFrom: Pablo Neira Ayuso <[email protected]>
Date: Thu, 28 May 2020 00:40:15 +0200
Quoted 7 lines
The following patchset contains Netfilter fixes for net:
1) Uninitialized when used in
__nf_conntrack_update(), from Nathan Chancellor.2) Comparison of unsigned expression in
nf_confirm_cthelper().
Quoted 7 lines
3) Remove 'const' type qualifier with no effect.
This batch is addressing fallout from the previous pull request.
Please, pull this updates from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Pulled, thanks.