s390/qeth: fixes 2018-09-12
Subsystems (4)
cover s390/qeth: fixes 2018-09-12
Hi Dave,
please apply the following qeth fixes for -net.
Patch 1 resolves a regression in an error path, while patch 2 enables the SG support by default that was newly introduced with 4.19. Patch 3 takes care of a longstanding problem with large-order allocations, and patch 4 fixes a potential out-of-bounds access.
Thanks,
Julian
Julian Wiedmann (3):
s390/qeth: indicate error when netdev allocation fails s390/qeth: switch on SG by default for IQD devices s390/qeth: don't dump past end of unknown HW header
Wenjia Zhang (1):
s390/qeth: use vzalloc for QUERY OAT buffer
drivers/s390/net/qeth_core_main.c | 11 ++++++++--- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.16.4
PATCH 1/4 s390/qeth: indicate error when netdev allocation fails
Bailing out on allocation error is nice, but we also need to tell the ccwgroup core that creating the qeth groupdev failed.
--- drivers/s390/net/qeth_core_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +3 -1
@@ -5768,8 +5768,10 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)qeth_update_from_chp_desc (card); card->dev =qeth_alloc_netdev (card); -if (!card->dev) +if (!card->dev) { + rc = -ENOMEM ; goto err_card; + }qeth_determine_capabilities (card); enforced_disc =qeth_enforce_discipline (card);
Signature · 1 line
2.16.4
PATCH 2/4 s390/qeth: switch on SG by default for IQD devices
In reply to Julian WiedmannScatter-gather transmit brings a nice performance boost. Considering the rather large MTU sizes at play, it's also totally the Right Thing To Do.
--- drivers/s390/net/qeth_core_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/s390/net/qeth_core_main.c +2 -0
@@ -5706,6 +5706,8 @@ static struct net_device *qeth_alloc_netdev(struct qeth_card *card) dev->priv_flags &= ~IFF_TX_SKB_SHARING ; dev->hw_features |=NETIF_F_SG ; dev->vlan_features |=NETIF_F_SG ; +if (IS_IQD (card)) + dev->features |=NETIF_F_SG ; }return dev;
Signature · 1 line
2.16.4
PATCH 3/4 s390/qeth: use vzalloc for QUERY OAT buffer
In reply to Julian WiedmannFrom: Wenjia Zhang <[email protected]>
qeth_query_oat_command() currently allocates the kernel buffer for the SIOC_QETH_QUERY_OAT ioctl with kzalloc. So on systems with fragmented memory, large allocations may fail (eg. the qethqoat tool by default uses 132KB).
Solve this issue by using vzalloc, backing the allocation with non-contiguous memory.
--- drivers/s390/net/qeth_core_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_core_main.c +3 -2
@@ -25,6 +25,7 @@#include <linux/netdevice.h> #include <linux/netdev_features.h> #include <linux/skbuff.h> +#include <linux/vmalloc.h> #include <net/iucv/af_iucv.h> #include <net/dsfield.h>
@@ -4699,7 +4700,7 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata) priv.buffer_len = oat_data.buffer_len; priv.response_len =0 ; - priv.buffer =kzalloc (oat_data.buffer_len,GFP_KERNEL ); + priv.buffer =vzalloc (oat_data.buffer_len);if (!priv.buffer) { rc = -ENOMEM ; goto out;
@@ -4740,7 +4741,7 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata) rc = -EFAULT ; out_free: -kfree (priv.buffer); +vfree (priv.buffer); out:return rc; }
Signature · 1 line
2.16.4
PATCH 4/4 s390/qeth: don't dump past end of unknown HW header
In reply to Julian WiedmannFor inbound data with an unsupported HW header format, only dump the actual HW header. We have no idea how much payload follows it, and what it contains. Worst case, we dump past the end of the Inbound Buffer and access whatever is located next in memory.
--- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -423,7 +423,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -1390,7 +1390,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,default :dev_kfree_skb_any (skb);QETH_CARD_TEXT (card,3 ,"inbunkno" ); -QETH_DBF_HEX (CTRL ,3 , hdr,QETH_DBF_CTRL_LEN ); +QETH_DBF_HEX (CTRL ,3 , hdr,sizeof (*hdr));continue ; } work_done++;
Signature · 1 line
2.16.4
David Miller
maintainerFrom: Julian Wiedmann <[email protected]>
Date: Wed, 12 Sep 2018 15:31:31 +0200
Quoted 6 lines
please apply the following qeth fixes for -net.
Patch 1 resolves a regression in an error path, while patch 2 enables the SG support by default that was newly introduced with 4.19. Patch 3 takes care of a longstanding problem with large-order allocations, and patch 4 fixes a potential out-of-bounds access.
Series applied, thanks Julian.