linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks
@ 2020-05-26 18:21 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2020-05-26 18:21 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	David S. Miller, Jakub Kicinski, netfilter-devel, coreteam,
	netdev
  Cc: linux-kernel

Hi,

Static analysis with Coverity has detected a potential issue with the
commit in linux-next:

commit 368982cd7d1bd41cd39049c794990aca3770db44
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Wed May 23 09:17:24 2018 +0200

    netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks

Namely:

2019 static int __nf_conntrack_update(struct net *net, struct sk_buff *skb,
2020                                 struct nf_conn *ct)
2021 {
2022        struct nf_conntrack_tuple_hash *h;
2023        struct nf_conntrack_tuple tuple;

    1. var_decl: Declaring variable ctinfo without initializer.

2024        enum ip_conntrack_info ctinfo;

...
...

2066        nf_ct_put(ct);
2067        ct = nf_ct_tuplehash_to_ctrack(h);

Uninitialized scalar variable (UNINIT)7. uninit_use_in_call:
Using uninitialized value ctinfo when calling nf_ct_set.

2068        nf_ct_set(skb, ct, ctinfo);
2069

the call to nf_ct_set uses info as follows:

316 static inline void
317 nf_ct_set(struct sk_buff *skb, struct nf_conn *ct, enum
ip_conntrack_info info)
318 {
319        skb_set_nfct(skb, (unsigned long)ct | info);
320 }

so this shows that the info arg (from ctinfo) is being used when it has
not been initialized.

Colin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-26 18:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 18:21 netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).