]> git.baikalelectronics.ru Git - kernel.git/commit
net: always initialize pagedlen
authorWillem de Bruijn <willemb@google.com>
Sat, 24 Nov 2018 19:21:16 +0000 (14:21 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 25 Nov 2018 01:42:57 +0000 (17:42 -0800)
commitc39fcc18dd8f78a3e302dddc5cbd610638f1473a
treedc960b49f6616419375e9fec056022c0e8e14338
parent46c1566582d43a04e251e214abbcf6be39f168a9
net: always initialize pagedlen

In ip packet generation, pagedlen is initialized for each skb at the
start of the loop in __ip(6)_append_data, before label alloc_new_skb.

Depending on compiler options, code can be generated that jumps to
this label, triggering use of an an uninitialized variable.

In practice, at -O2, the generated code moves the initialization below
the label. But the code should not rely on that for correctness.

Fixes: 602bf6f663da ("udp: paged allocation with gso")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c
net/ipv6/ip6_output.c