s390/qeth: fix L3 next-hop in xmit qeth hdr
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Mon, 7 Aug 2017 11:28:39 +0000 (13:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Aug 2017 18:24:37 +0000 (11:24 -0700)
commitec2c6726322f0d270bab477e4904bf9496f70ee5
tree35d291579cbd082f0c0f4face4323a29d3510b68
parentc0e0fb837909f22b93fbb05e365be215a9e75d10
s390/qeth: fix L3 next-hop in xmit qeth hdr

On L3, the qeth_hdr struct needs to be filled with the next-hop
IP address.
The current code accesses rtable->rt_gateway without checking that
rtable is a valid address. The accidental access to a lowcore area
results in a random next-hop address in the qeth_hdr.
rtable (or more precisely, skb_dst(skb)) can be NULL in rare cases
(for instance together with AF_PACKET sockets).
This patch adds the missing NULL-ptr checks.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Fixes: 87e7597b5a3 qeth: Move away from using neighbour entries in qeth_l3_fill_header()
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l3_main.c