[SRU][Bionic][Cosmic][PATCH 0/1] s390/qeth: use vzalloc for QUERY OAT buffer

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][Cosmic][PATCH 0/1] s390/qeth: use vzalloc for QUERY OAT buffer

Joseph Salisbury-3
BugLink: https://bugs.launchpad.net/bugs/1793086

== SRU Justification ==
IBM reports the qethqoat tool fails.  qeth_query_oat_command() currently
allocates the kernel buffer for the SIOC_QETH_QUERY_OAT ioctl with kzalloc.

This commit will cause the use of vzalloc() instead of kzalloc(), backing
the allocation with non-contiguous memory.

Xenial also needs this commit, but requres a slightly different
backport.  It's SRU will be sent separate.

== Fix ==
aec45e857c55 ("s390/qeth: use vzalloc for QUERY OAT buffer")

== Regression Potential ==
Low, limited to s390.

== Test Case ==
IBM verified testing of this commit up-front.

Wenjia Zhang (1):
  s390/qeth: use vzalloc for QUERY OAT buffer

 drivers/s390/net/qeth_core_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][Bionic][Cosmic][PATCH 1/1] s390/qeth: use vzalloc for QUERY OAT buffer

Joseph Salisbury-3
From: Wenjia Zhang <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1793086

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.

Signed-off-by: Wenjia Zhang <[hidden email]>
Reviewed-by: Julian Wiedmann <[hidden email]>
Signed-off-by: Julian Wiedmann <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit aec45e857c5538664edb76a60dd452e3265f37d1)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 drivers/s390/net/qeth_core_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index d01ac29..02b7352 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -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>
@@ -4737,7 +4738,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;
@@ -4778,7 +4779,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;
 }
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Bionic][Cosmic][PATCH 1/1] s390/qeth: use vzalloc for QUERY OAT buffer

Stefan Bader-2
On 20.09.2018 11:31, Joseph Salisbury wrote:

> From: Wenjia Zhang <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1793086
>
> 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.
>
> Signed-off-by: Wenjia Zhang <[hidden email]>
> Reviewed-by: Julian Wiedmann <[hidden email]>
> Signed-off-by: Julian Wiedmann <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit aec45e857c5538664edb76a60dd452e3265f37d1)
> Signed-off-by: Joseph Salisbury <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  drivers/s390/net/qeth_core_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
> index d01ac29..02b7352 100644
> --- a/drivers/s390/net/qeth_core_main.c
> +++ b/drivers/s390/net/qeth_core_main.c
> @@ -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>
> @@ -4737,7 +4738,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;
> @@ -4778,7 +4779,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;
>  }
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU][Bionic][Cosmic][PATCH 1/1] s390/qeth: use vzalloc for QUERY OAT buffer

Kleber Souza
In reply to this post by Joseph Salisbury-3
On 09/20/18 11:31, Joseph Salisbury wrote:

> From: Wenjia Zhang <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1793086
>
> 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.
>
> Signed-off-by: Wenjia Zhang <[hidden email]>
> Reviewed-by: Julian Wiedmann <[hidden email]>
> Signed-off-by: Julian Wiedmann <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit aec45e857c5538664edb76a60dd452e3265f37d1)
> Signed-off-by: Joseph Salisbury <[hidden email]>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>  drivers/s390/net/qeth_core_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
> index d01ac29..02b7352 100644
> --- a/drivers/s390/net/qeth_core_main.c
> +++ b/drivers/s390/net/qeth_core_main.c
> @@ -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>
> @@ -4737,7 +4738,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;
> @@ -4778,7 +4779,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;
>  }
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED[B]: [SRU][Bionic][Cosmic][PATCH 0/1] s390/qeth: use vzalloc for QUERY OAT buffer

Stefan Bader-2
In reply to this post by Joseph Salisbury-3
On 20.09.2018 11:31, Joseph Salisbury wrote:

> BugLink: https://bugs.launchpad.net/bugs/1793086
>
> == SRU Justification ==
> IBM reports the qethqoat tool fails.  qeth_query_oat_command() currently
> allocates the kernel buffer for the SIOC_QETH_QUERY_OAT ioctl with kzalloc.
>
> This commit will cause the use of vzalloc() instead of kzalloc(), backing
> the allocation with non-contiguous memory.
>
> Xenial also needs this commit, but requres a slightly different
> backport.  It's SRU will be sent separate.
>
> == Fix ==
> aec45e857c55 ("s390/qeth: use vzalloc for QUERY OAT buffer")
>
> == Regression Potential ==
> Low, limited to s390.
>
> == Test Case ==
> IBM verified testing of this commit up-front.
>
> Wenjia Zhang (1):
>   s390/qeth: use vzalloc for QUERY OAT buffer
>
>  drivers/s390/net/qeth_core_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
Applied to bionic/master-next. Thanks.

-Stefan


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED[C]: [SRU][Bionic][Cosmic][PATCH 0/1] s390/qeth: use vzalloc for QUERY OAT buffer

Thadeu Lima de Souza Cascardo-3
In reply to this post by Joseph Salisbury-3
Applied to cosmic master-next. Unstable already has it.

Thanks.
Cascardo.

Applied-to: cosmic/master-next

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team