ipvs: handle ip_vs_fill_iph_skb_off failure
authorArnd Bergmann <arnd@arndb.de>
Wed, 27 Jan 2016 13:52:02 +0000 (14:52 +0100)
committerSimon Horman <horms@verge.net.au>
Mon, 7 Mar 2016 02:53:28 +0000 (11:53 +0900)
commit3f20efba41916ee17ce82f0fdd02581ada2872b2
tree2a9b16e7518b16ea8ce8dd24748ef29ae853505b
parent017b1b6d28c479f1ad9a7a41f775545a3e1cba35
ipvs: handle ip_vs_fill_iph_skb_off failure

ip_vs_fill_iph_skb_off() may not find an IP header, and gcc has
determined that ip_vs_sip_fill_param() then incorrectly accesses
the protocol fields:

net/netfilter/ipvs/ip_vs_pe_sip.c: In function 'ip_vs_sip_fill_param':
net/netfilter/ipvs/ip_vs_pe_sip.c:76:5: error: 'iph.protocol' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (iph.protocol != IPPROTO_UDP)
     ^
net/netfilter/ipvs/ip_vs_pe_sip.c:81:10: error: 'iph.len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  dataoff = iph.len + sizeof(struct udphdr);
          ^

This adds a check for the ip_vs_fill_iph_skb_off() return code
before looking at the ip header data returned from it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b0e010c527de ("ipvs: replace ip_vs_fill_ip4hdr with ip_vs_fill_iph_skb_off")
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
net/netfilter/ipvs/ip_vs_pe_sip.c
This page took 0.02569 seconds and 5 git commands to generate.