Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3322686imm; Sun, 30 Sep 2018 17:48:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62tUQOQT6T4gSAjZ0j2dY6fgaZrwSCTtghCvAtOGr22X+w1hGmlbbSPLwjpL836s6+HukFG X-Received: by 2002:a63:e141:: with SMTP id h1-v6mr7762433pgk.47.1538354899664; Sun, 30 Sep 2018 17:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538354899; cv=none; d=google.com; s=arc-20160816; b=o6y6Mbz1BTjvoZ1QGGiF3UhEGrVq6lB+U6amF7igZF2vsvyuRGNCRDEgzJLFQmtz3K sLvulCUr8TpFoMluGt6B6ChvyTBx89TYeZvYnRiti4Pu73v9kLDG89Tx2a4eeItyDyUW ks/V/JtTP3/CiaqYSGpjwgdLp6t90VYCU738YWjS2gtj3uN3OVpE5dx7MEFAzbHJ1y8I s8mkxoej1xCyLRxESE2gnIQEGG8yTTnEHS/vsiPOooHNbZCWhDzivbLq2n9l3tSaTS6j jepwCLMo+1Ue69SRJjRezveUV4HbfHcw3mxZRDC/cKgf0QrDaNA3PxsbMcCxHAmUstzW ELrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=NummEWlUqPppN6UzKCy2l+aM6Ae7hMxML+jl7FfV7LQ=; b=IfYe8O1gysErTifAn4FBqw2QI1weXuR4vFkY0mLrWR1bMfU+omn+3rK3XPSjb/ysYU 5VH4m1qiMoIJzkHzTpyXMHsA3wx01q5Ytsx1n6636d9V60TJCAUPTatT60v39sbBo8tg HtvJ5r2L2caMn7jndEZV2AipCp4ClV6mWHFr52uKY8SAKt+dJL2glJZdStmPugnYqUfJ FMB7eELvjn9BFbNjkSHCV35Hq/kOrdUTt81QdZPacstx4CX5y6PkKxyMe1EE2phvY1GM 22H+ebQSxur5WOm2ZDXbYqjuJUsnNXVcgcZpAzRLZtW4ueSsuQUlJdC3V4yHL8E4Hapx 58dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PCG6NNV8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34-v6si12043864plb.2.2018.09.30.17.48.05; Sun, 30 Sep 2018 17:48:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PCG6NNV8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbeJAHWF (ORCPT + 99 others); Mon, 1 Oct 2018 03:22:05 -0400 Received: from mail-by2nam01on0090.outbound.protection.outlook.com ([104.47.34.90]:27744 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729354AbeJAHPe (ORCPT ); Mon, 1 Oct 2018 03:15:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NummEWlUqPppN6UzKCy2l+aM6Ae7hMxML+jl7FfV7LQ=; b=PCG6NNV8D6OLnUURKjbL+sd+3NHBGAeWCZmKIuLLoWQxUYzf07aQ1sTIceHO/EpWvWIPj/pBTjAQOjqNkThsQZ4Uw0HemiRenB8StYs/fAtgHE2LoQ6hPIRoeHPWkGlSu+gk3vHvILkS4qWwLjx3mdW7DlofuCrHthisOL3+3wc= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0854.namprd21.prod.outlook.com (10.173.192.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.4; Mon, 1 Oct 2018 00:40:19 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1228.006; Mon, 1 Oct 2018 00:40:19 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Wenjia Zhang , Julian Wiedmann , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 32/37] s390/qeth: use vzalloc for QUERY OAT buffer Thread-Topic: [PATCH AUTOSEL 4.14 32/37] s390/qeth: use vzalloc for QUERY OAT buffer Thread-Index: AQHUWR8sD9+DcNP3N02ZqMcqWHcLlQ== Date: Mon, 1 Oct 2018 00:39:13 +0000 Message-ID: <20181001003850.147107-32-alexander.levin@microsoft.com> References: <20181001003850.147107-1-alexander.levin@microsoft.com> In-Reply-To: <20181001003850.147107-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0854;6:6uQTDMGabi7YyTibD7XQ/HufI2uhe8VMQgAmjvTffso59NCL866nCAA1Zk3O9fyWqGi14kcJFDFnZJeOUoic/VagKnXLJq2Gwxn0hWI+FsaY2ZHM+mJn3x9NgQvMslscbvRh+cB8Z7G7moZUUJi0tFzBpfn25ceorHG2yOK9p6veJSWXUR4o4Mx+a68bXgb0rv7ZEMcxSI4GNlUI0PWbrDFyPl7vIrMy5K/ecEp3B55IhhFELeb2eVB23K3r5xqwMmcSs41HCp1qGOU66Zjr9hQpvZ4aNxfjlB6wDsAodRwAWQR/WMv1OuhA+pT3GPdod5Lp+wW9Kh3QXGPFTB30tDDyit7l8zk7i8Rxspci0vmbP3FDnduVId2Uj595H91hcIjbdT8rQ9IzUL5Xk4dp+3vl17xGOywrxoWz95cX2TWaa+uRztmtb0hqwb5nf7MWacubKtLnUUOZJIRMlInjmg==;5:km3CS4wQKrsUPI0rizMPYKUoUxv01EvdEIHLZpm/NR1NKWoUN60Va4i85VipcRcPllEQ4fsy/8hGkExrk+IUt+JbDSESK4Plf6ZYo44JvlZCjaCyphlB+09QLjuy61V98AV+q9a8aAnFC/eGgnJ20+Ao9qkqVxiPu3+vwYsM5e8=;7:fpZbU7XWAYGdHWoLyevVQwphRTKzt4hO1Rtgl3nUzaHH8spJB9RkQxTaCHNzLCaSx3FNBS+oLW5fwRYCgGzEGIW6WYRBh2+wrq6DY0US+oeUohrjCeV7D5nKaVBHhio/Oj2Imyh+2StjbF9Zph0JP5tzQYcHadiNZcKNII7lTkjrl7uXKhlITpED2itAxiDIb0Yw6ZmtyACPGFrNjkIgrOT5UjNcPwanxYo8i1LRueIM+VMCIGW4U764CctUCsX8 x-ms-office365-filtering-correlation-id: 11fdf29a-0822-473c-ecb1-08d6273676b3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:CY4PR21MB0854; x-ms-traffictypediagnostic: CY4PR21MB0854: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(104084551191319)(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(2018427008)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991041);SRVR:CY4PR21MB0854;BCL:0;PCL:0;RULEID:;SRVR:CY4PR21MB0854; x-forefront-prvs: 0812095267 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(346002)(39860400002)(136003)(366004)(199004)(189003)(6116002)(3846002)(217873002)(5250100002)(1076002)(71200400001)(97736004)(71190400001)(76176011)(6506007)(99286004)(36756003)(6346003)(26005)(2906002)(446003)(86362001)(11346002)(476003)(102836004)(2616005)(14454004)(2501003)(10090500001)(107886003)(4326008)(22452003)(486006)(316002)(34290500001)(186003)(256004)(66066001)(86612001)(305945005)(25786009)(2900100001)(6486002)(106356001)(7736002)(6512007)(53936002)(81166006)(81156014)(6666003)(8936002)(8676002)(5660300001)(68736007)(54906003)(110136005)(10290500003)(6436002)(478600001)(72206003)(105586002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0854;H:CY4PR21MB0776.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: uBgIt7913yZAtjBx3SagnSj5dOUDBYwShUNtWEQuor0b7k+8AfJhUn4fH91HrMDK5RvIUnfe2tmp4g+tHMy5lFUlInKpHreDI8tVNxCzEzMy0+pZv/jiNhK+azY950BkwEPtHJPwD1fZEcM/V1eHSetOmk85GFKGByKFZKJlOvS0fcBHCpaI9oq+oznMZ7ANnoDbnt2SepzFjPit5KdKEYLnEHl72cQgSbO0y8iBEruG6dRzg2KBXBw56xvGFuWTtoaDIuUNoWbXpbYbv7OG1hC6D89aL2d3uLZuhNSRiLfgVubhBoQAKUB5uYFhi1hD99eOrZe+SgBq6w/kjsvNfnxq/ouXneVtjJHNL4m4mpw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11fdf29a-0822-473c-ecb1-08d6273676b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2018 00:39:13.0617 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0854 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wenjia Zhang [ Upstream commit aec45e857c5538664edb76a60dd452e3265f37d1 ] 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 Reviewed-by: Julian Wiedmann Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 0a6afd4b283d..4f2747cd15a6 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -23,6 +23,7 @@ #include #include #include +#include =20 #include #include @@ -4728,7 +4729,7 @@ static int qeth_query_oat_command(struct qeth_card *c= ard, char __user *udata) =20 priv.buffer_len =3D oat_data.buffer_len; priv.response_len =3D 0; - priv.buffer =3D kzalloc(oat_data.buffer_len, GFP_KERNEL); + priv.buffer =3D vzalloc(oat_data.buffer_len); if (!priv.buffer) { rc =3D -ENOMEM; goto out; @@ -4769,7 +4770,7 @@ static int qeth_query_oat_command(struct qeth_card *c= ard, char __user *udata) rc =3D -EFAULT; =20 out_free: - kfree(priv.buffer); + vfree(priv.buffer); out: return rc; } --=20 2.17.1