Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3289682pxk; Mon, 21 Sep 2020 09:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIY/a8sUJC8ly9dnurSHLLx5S2VFo7+8NufRyxlC0ZFqv2PfgeUUuKf84WI78yIF0hQj+R X-Received: by 2002:a17:906:fb84:: with SMTP id lr4mr375712ejb.282.1600706898612; Mon, 21 Sep 2020 09:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706898; cv=none; d=google.com; s=arc-20160816; b=bu9u53b7T17ko7DiMIBrVBPKEoVmq4+ndSFVm7X89qZLYhyj1Aib4M2lNCwbAQeaJR mCqYo7u0fhdBB6W9DkL4aCRSN4FRU5hYhSCTZSDvSFREBYYytSlpyp0efhcqyltQf8bl 1Y2LAgvoeBQGOorZM7qgKdGsFNDQtuYCsbr8EaSyE2EwLxEqf9Zzm3DpCw2s+EChxIcW PxHj+2OiVrLebVSX5qOLp91qY3U9+OPw1XT+dIuJ5XpsfJW2dHo5cqEwTM/Z873gsxnj YIrKQryjk74WZz/+JcybRFR9HTC3uh2ZApkW6G+YKwSiHhN1rNdFB/2DWS7ZJ5nVnMlO Y+Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oUKAgooHFCyzAtHbEmFwyer2HKIefsfSNaOSLJ0I7OQ=; b=xS8+mGGoGvRPwT+lTE0cTxmqwbUwmPdkkAxOBc2U4PQMIc/0LsFGlJZYqcoIGj9EQl gjibNdkE337+CzCYJzqv7C+2MEXmG7daAOYybmjsCU7Bzet6FnaYGcNKKV1JotBl1D6t p/nEUxcqOALDPXRgGvrZiH0M8HHKgbd7gHBA2dHCI/TdfsG5o9Oec3IBTqi5bzLFVMle DQD8622zvLNreZ4InbXA54nIlGRxKmI2d61gApfqvbRjRpwQSryOWPnGONkg2HYsls1y KQeCIu8/Naa1doMqtqtJV3BrjRRMlvud9Yxr+ZoSBGOG64/jWAZaqvRDa3j/r3b90Gcq MrGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1Ez3f6iN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si8518694edi.48.2020.09.21.09.47.55; Mon, 21 Sep 2020 09:48:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1Ez3f6iN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729717AbgIUQrF (ORCPT + 99 others); Mon, 21 Sep 2020 12:47:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729590AbgIUQrE (ORCPT ); Mon, 21 Sep 2020 12:47:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 727F6238D6; Mon, 21 Sep 2020 16:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706824; bh=1Bp/N8b6BrR0j8s83qx3/wG4R3CA7d56WlGFrJgI4oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Ez3f6iNgRPaDdX9kKS9T6ecjUpVBuXhekZAOWIxcwk+uaIiJlNJK/B/IFlihfY25 uGaoVxBHJcLeZs8IEvSmpVqBRh6vwEZTu3DjYFmBvJR5t6R3x0KxmouMePImUCtZWk AtFXTn1rCQsGFsY3AnZTTB8fjDUxhoGtnC92mrHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harald Freudenberger , Ingo Franzki , Vasily Gorbik Subject: [PATCH 5.8 108/118] s390/zcrypt: fix kmalloc 256k failure Date: Mon, 21 Sep 2020 18:28:40 +0200 Message-Id: <20200921162041.396732093@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harald Freudenberger commit b6186d7fb53349efd274263a45f0b08749ccaa2d upstream. Tests showed that under stress conditions the kernel may temporary fail to allocate 256k with kmalloc. However, this fix reworks the related code in the cca_findcard2() function to use kvmalloc instead. Signed-off-by: Harald Freudenberger Reviewed-by: Ingo Franzki Cc: Stable Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- drivers/s390/crypto/zcrypt_ccamisc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/s390/crypto/zcrypt_ccamisc.c +++ b/drivers/s390/crypto/zcrypt_ccamisc.c @@ -1685,9 +1685,9 @@ int cca_findcard2(u32 **apqns, u32 *nr_a *nr_apqns = 0; /* fetch status of all crypto cards */ - device_status = kmalloc_array(MAX_ZDEV_ENTRIES_EXT, - sizeof(struct zcrypt_device_status_ext), - GFP_KERNEL); + device_status = kvmalloc_array(MAX_ZDEV_ENTRIES_EXT, + sizeof(struct zcrypt_device_status_ext), + GFP_KERNEL); if (!device_status) return -ENOMEM; zcrypt_device_status_mask_ext(device_status); @@ -1755,7 +1755,7 @@ int cca_findcard2(u32 **apqns, u32 *nr_a verify = 0; } - kfree(device_status); + kvfree(device_status); return rc; } EXPORT_SYMBOL(cca_findcard2);