Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1930417pxu; Sun, 13 Dec 2020 07:57:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6pDiWQ4YtZMtGSYbLuJgXKB2Pt/kVpIy/PT3xAPGTRoxbB6KBTAY6MCH0kWLXapuYJvJQ X-Received: by 2002:a05:6402:352:: with SMTP id r18mr20342038edw.373.1607875062998; Sun, 13 Dec 2020 07:57:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607875062; cv=none; d=google.com; s=arc-20160816; b=BS+GXc44IGTNuHcnT6VEhd11eksa0rL+ayqmCbd9HjGgzOLb5aHOGG7PTMboRwt8M3 03wD3ck2eix4jL8Fn2ZHKryoNL0nu5nB5svN/7s/K7NOCsR11b9/UNXk+0vX8oJWE94+ s+48NiVT2cP3yGrRnai6ARkXdNtryR9pW7xArr3gs+S5IggTCVVge9xImJYxv+6XKqQt Qhv244sN74lgH3ibM3kh6/r8h6CsXPtHJYhQITTzYyH7EIeJvNjJBPtSdtqTaLgJCfUi GpqUZzwrUS87zcMtwYVTYRXtwtH779X1UA+cPN4Mf/WtrRGzEgohmEkZENe/cVRnELeL 0a3g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MnNEP8sKqTmUpoY7XmImer01ktgsG626nhQfc5YtERM=; b=V2joFlLcrsjvterhZgJEa8sEH1IdXE66kl9av4LHL1Wng2q3Qsx47vM6iYsHmkVY2/ 5NYH9VJRID0AhOK+INAWEAS8FTqCxR0yRyWy5+1UTKrN0moHV839fecuaoKuGfRexMmb uyl2WMPbaDPVRDbeGyP7wg1ytUTQs3wYTZX+WIQZTzd6+P4Hro4aiYlfdWwfR7Yx77Gl RtVsDwDeNb0EjD4gnXcojDptLhOZ/VogSAX2m4YyWno2F/sHZHbkjcUDD8f2zECEC8WN YVntFrdM+30FFBDHDnavu5OV2ZLmIKxlAdg9q+30uLzwnJqUWMbFKLswk4Kgj6592n4B SStQ== ARC-Authentication-Results: i=1; mx.google.com; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh5si7906613ejb.488.2020.12.13.07.57.20; Sun, 13 Dec 2020 07:57:42 -0800 (PST) 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; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439370AbgLLQJ3 (ORCPT + 99 others); Sat, 12 Dec 2020 11:09:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:57004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439333AbgLLQIu (ORCPT ); Sat, 12 Dec 2020 11:08:50 -0500 From: Sasha Levin Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mikulas Patocka , Mike Snitzer , Sasha Levin , dm-devel@redhat.com, linux-raid@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 04/23] dm integrity: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY Date: Sat, 12 Dec 2020 11:07:45 -0500 Message-Id: <20201212160804.2334982-4-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201212160804.2334982-1-sashal@kernel.org> References: <20201212160804.2334982-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit a7a10bce8a04f48238a8306ec97d430b77917015 ] Don't use crypto drivers that have the flag CRYPTO_ALG_ALLOCATES_MEMORY set. These drivers allocate memory and thus they are not suitable for block I/O processing. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 3fc3757def55e..5a7a1b90e671c 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -3462,7 +3462,7 @@ static int get_mac(struct crypto_shash **hash, struct alg_spec *a, char **error, int r; if (a->alg_string) { - *hash = crypto_alloc_shash(a->alg_string, 0, 0); + *hash = crypto_alloc_shash(a->alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY); if (IS_ERR(*hash)) { *error = error_alg; r = PTR_ERR(*hash); @@ -3519,7 +3519,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error) struct journal_completion comp; comp.ic = ic; - ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, 0); + ic->journal_crypt = crypto_alloc_skcipher(ic->journal_crypt_alg.alg_string, 0, CRYPTO_ALG_ALLOCATES_MEMORY); if (IS_ERR(ic->journal_crypt)) { *error = "Invalid journal cipher"; r = PTR_ERR(ic->journal_crypt); -- 2.27.0