Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp694359pxb; Tue, 5 Apr 2022 19:05:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkdeDInFZQ+3e97sC5ZQBHP82nBagItuNk+rkfjQPH9hNUjnGkItAh3BT5lqb7bK3HzEbZ X-Received: by 2002:a62:1dc9:0:b0:4fa:e4d2:7745 with SMTP id d192-20020a621dc9000000b004fae4d27745mr6342909pfd.61.1649210591098; Tue, 05 Apr 2022 19:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210591; cv=none; d=google.com; s=arc-20160816; b=IAIr+7pF+69Vqln+3u7WzVcmEUsrcExTiB2moTNL62kx17qwmrPg5x24QBIHyvu+S4 3MFaraSaK5krcXxJzUqs6Jo2IWfpDEUZ4Zt8JwN0xLjo42WLbHQtq4dFxJzdwvidiqwa i2EK80cQIiso/hMLGtwPycSKdg+iTVY2s6+5QSxKwocXPESxX6bqxakyNUwSdyMG4Zd2 tbRkaGsG0LkBjz/7uF55PibGtck/i3Qzo16gl75yUnKvcPB2VY85zFCDX5zpG8zpJc0X wZEQx+j6VDu5qf4Ot7+9sEbTM84+ZKRpB8pQelJyfrFH/QsjwXq+xO0at4zNVQe6JY59 I8Uw== 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=jjwLTCQDEv2PeC7T0wSg3jBiqSq2ea+L73qjcnexZOQ=; b=PZi5dL8oKhEQFOwHfUAxK+KSGBjS8bkDZ7ukPD4F35JpoRvlzyCzPcp3TeGMeSpAeB OIIaDDwbZ+dK6I7TuMsVqccZJRVi4oyhpvgD9KtzHOa8hZpu6NMnta6SxBAZ0Tke+uY0 Q2w/d0rR/wlmFR8t3Opem1UijtpovAd+4V3gRRgkkd3b5aMN8gStK4fwMTYsanBdyuno 89VT8775HcnhdT+bxH8kByK9zj/2lBubb1FRMBT8/303JI11uWQLA8xkVvEwqBeHbWGn e2nk7g7ekQWsLzDYsQiuIzKsW7a9pKz5O6iHyjm6PLrBdEo7VrlJUm2C/R60uaMMkHvO CjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="r/vHtTnm"; 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 y10-20020a17090a600a00b001c7ce042e17si3919314pji.83.2022.04.05.19.02.53; Tue, 05 Apr 2022 19:03:11 -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="r/vHtTnm"; 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 S1378001AbiDELbO (ORCPT + 99 others); Tue, 5 Apr 2022 07:31:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244164AbiDEIvr (ORCPT ); Tue, 5 Apr 2022 04:51:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA7BBD3AC4; Tue, 5 Apr 2022 01:40:26 -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 465D9B81BBF; Tue, 5 Apr 2022 08:40:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98C9EC385A1; Tue, 5 Apr 2022 08:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148025; bh=EIqZGIC3MEY6zK++/3lavNvUv7djR+iZn/Z4aFTomR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r/vHtTnmCOWrGPF/ynyA0PZfOtZCMTuVm4vCfKV/hJJy04q8f687FPSrn+OZPwu+l 5mpAYyZWUWVQH05kxmIN6AeXy0GWNbGNEBW9Jyh3viexeOGaHNWcaEK2q1AQlZw2O9 Ph4j8ny6q7gxBQkJUtniVRSTf+f8YHkel8SQWXEw= 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 5.16 0207/1017] crypto: authenc - Fix sleep in atomic context in decrypt_tail Date: Tue, 5 Apr 2022 09:18:40 +0200 Message-Id: <20220405070400.395510344@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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.1 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 670bf1a01d00..17f674a7cdff 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -253,7 +253,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