]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1d477c29a022db19a1170c048ff595ec7ea267b0
tree35d291579cbd082f0c0f4face4323a29d3510b68
parent507a23d6c7f58bc806a3c779c6287a48ca06ddb1
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: 8aba23598a7 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