* [PATCH net 0/1] s390/qeth fix
@ 2017-08-07 11:28 Ursula Braun
2017-08-07 11:28 ` [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr Ursula Braun
0 siblings, 1 reply; 3+ messages in thread
From: Ursula Braun @ 2017-08-07 11:28 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, jwi, schwidefsky, heiko.carstens, raspl, ubraun
Hi Dave,
please apply the following qeth bug fix for net.
Thanks, Ursula
Julian Wiedmann (1):
s390/qeth: fix L3 next-hop in xmit qeth hdr
drivers/s390/net/qeth_l3_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.11.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr
2017-08-07 11:28 [PATCH net 0/1] s390/qeth fix Ursula Braun
@ 2017-08-07 11:28 ` Ursula Braun
2017-08-07 18:25 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Ursula Braun @ 2017-08-07 11:28 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, jwi, schwidefsky, heiko.carstens, raspl, ubraun
From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
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()
---
drivers/s390/net/qeth_l3_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 8975cd321390..d42e758518ed 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2512,7 +2512,7 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
struct rtable *rt = (struct rtable *) dst;
__be32 *pkey = &ip_hdr(skb)->daddr;
- if (rt->rt_gateway)
+ if (rt && rt->rt_gateway)
pkey = &rt->rt_gateway;
/* IPv4 */
@@ -2523,7 +2523,7 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
struct rt6_info *rt = (struct rt6_info *) dst;
struct in6_addr *pkey = &ipv6_hdr(skb)->daddr;
- if (!ipv6_addr_any(&rt->rt6i_gateway))
+ if (rt && !ipv6_addr_any(&rt->rt6i_gateway))
pkey = &rt->rt6i_gateway;
/* IPv6 */
--
2.11.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr
2017-08-07 11:28 ` [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr Ursula Braun
@ 2017-08-07 18:25 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2017-08-07 18:25 UTC (permalink / raw)
To: ubraun; +Cc: netdev, linux-s390, jwi, schwidefsky, heiko.carstens, raspl
From: Ursula Braun <ubraun@linux.vnet.ibm.com>
Date: Mon, 7 Aug 2017 13:28:39 +0200
> From: Julian Wiedmann <jwi@linux.vnet.ibm.com>
>
> 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()
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-07 18:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 11:28 [PATCH net 0/1] s390/qeth fix Ursula Braun
2017-08-07 11:28 ` [PATCH net 1/1] s390/qeth: fix L3 next-hop in xmit qeth hdr Ursula Braun
2017-08-07 18:25 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.