Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3853628pxb; Tue, 19 Apr 2022 11:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1N70xzcEIaMons59ihqcbbvphjP5XPY+9C0wAPdWEqjE2+YuA89D6n2Cwc8LqPHFiAXqb X-Received: by 2002:a63:2248:0:b0:39d:48fd:7d73 with SMTP id t8-20020a632248000000b0039d48fd7d73mr16056626pgm.372.1650391621996; Tue, 19 Apr 2022 11:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650391621; cv=none; d=google.com; s=arc-20160816; b=QMLVj1SWmLkPzFdLjMcGCQDpaN75BCf8wYsnjYg5ClzGqJ8f6ElrNSsGwIJW5yHXMl yoUyiSrWoDUHUGY5CJKTFV5K56oFaPKq5xbRG+/BbwhfmEYttYPgJywJcScDRYzxQtkc 8I6rQpDgZO8m0stdo6HWAj8sO60Cl0Mf8dfrKHGod5HhGldG9cbrv/qBHOEVCHyRzJ33 drmTIHtaBVntk5GtihgcSCquNhwOq2+aAv+fhpvd0VfYwBATNPW+RhaIV7PrzDfUgXTl a1O95uzNPRqQUPZ7/bJc9uQh7Apd6MZLhYs3csNqGfRylNe+wJpmPjZoSsazcrYwg7wI O/nQ== 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=pqjpLKPtq/onKfq6wVgygUAUtrZxdLbQwGZ9OV1PnBc=; b=0srTzc2Qfmsyuudff1/b9uBm39IOpd54Omcw2qDAEEbawQ0vACMcB0gmMbMrJbze+9 25oZWJGK8DVWChMMFjuw4AZInIh2zxfYPKOwafKHoC+cjlaOIUyd/k1BUmyphDWzrv8l /x6Cq7hXQX/V/udQKVGIPznxtbiZFCjVNVeA7eh11b1y3ubDeS5aF0Yuv8wsCla2+aoI Q+32RhPMW7hxb5x5mWBr+uVdIDb2ibzkfKrLbDXKY7jJqeQT1P6AzDmdfRN5XijKUFlq geqKQA42fhpaMKLI03wIlehwwbRnH/CXXCfCxYnWt+XeBnOimASrRSeDCAxa+1M+jUig j4PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vy4bwrnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t70-20020a638149000000b0039d61d31f02si21340pgd.50.2022.04.19.11.06.44; Tue, 19 Apr 2022 11:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vy4bwrnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242485AbiDRNhF (ORCPT + 99 others); Mon, 18 Apr 2022 09:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243707AbiDRNKY (ORCPT ); Mon, 18 Apr 2022 09:10:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A07DD26DE; Mon, 18 Apr 2022 05:49:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 613F7B80EE1; Mon, 18 Apr 2022 12:49:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3C81C385A8; Mon, 18 Apr 2022 12:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286176; bh=jSmZMcvSkSe1LBly2aT57pfhxF45RhCNh/KbiUBO+tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vy4bwrnYISuvWwKwfO7p1TLc1gv9M7OKAucsHyrWPjdwURYO6bFkd0ny7TU8tv6L8 Fq9YmyYWaJIm6PVUvtmNwahaUbHIJh0XNKOr8bpTNvyvBK5jUeoVqQb8ag/U7pPRYK NOumCVJUKIeR9vZm+HI8zZhT1yjTEHI/xY9Sdyyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 053/284] crypto: authenc - Fix sleep in atomic context in decrypt_tail Date: Mon, 18 Apr 2022 14:10:34 +0200 Message-Id: <20220418121212.204177542@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Herbert Xu [ Upstream commit 66eae850333d639fc278d6f915c6fc01499ea893 ] The function crypto_authenc_decrypt_tail discards its flags argument and always relies on the flags from the original request when starting its sub-request. This is clearly wrong as it may cause the SLEEPABLE flag to be set when it shouldn't. Fixes: 92d95ba91772 ("crypto: authenc - Convert to new AEAD interface") Reported-by: Corentin Labbe Signed-off-by: Herbert Xu Tested-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/authenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/authenc.c b/crypto/authenc.c index 053287dfad65..533e811a0899 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -268,7 +268,7 @@ static int crypto_authenc_decrypt_tail(struct aead_request *req, dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); skcipher_request_set_tfm(skreq, ctx->enc); - skcipher_request_set_callback(skreq, aead_request_flags(req), + skcipher_request_set_callback(skreq, flags, req->base.complete, req->base.data); skcipher_request_set_crypt(skreq, src, dst, req->cryptlen - authsize, req->iv); -- 2.34.1