Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4814404yba; Tue, 30 Apr 2019 04:58:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdxVgk0b/lAhSNpk5nLeFNfQ74Tbq9Q9M+tDqLbs7ySzRKaeGoX2MHtguAPeyMYd6nY6/t X-Received: by 2002:a63:ed4f:: with SMTP id m15mr67236429pgk.387.1556625510915; Tue, 30 Apr 2019 04:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625510; cv=none; d=google.com; s=arc-20160816; b=iALwJLIfh+igYrNyrJSSuUjZWaRZkbeeQ/6NxmLxOYWB/gzwMh376VamcQCei8GfQn YwT4l8VQZc/kLuQQxYVddFGPYEj0/cxEDj+bqbs17aj7ELgaUcsiW8Ne1lVdOvSbzsgZ S1430avBIotJVZ5YYGQ0MESKBVqmAlsDxU2mVsYaG/vs7g3SOt733tF2njwBzRvY2eHr 9+iv9Y2XNjOgNsd871s8zIqU9OVIcdiyEN/zDxkR+qE+NbHoa77ZpTiOlIc37rpy2q37 CiXfuIF2o0TQrBBnXbO+tXRUVJ75DdezQy0vroOiFixi2yrXI6Rzs2Rm/akSePEHv3Qd 2YlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b7q8XWoKltzGJeQaIAj3Mp9J3BwdYVvATKnGU05qLcQ=; b=whAt9UPjthAbadUT0E2ziiOT8W+V4J3lMgNW6KKhdSCnbEsqS4YN+77z/NTfvKXDks s5SDrisxwIMZtigAaPzAaO50yXcqGOk+ERffldK88/jLbxrbAqjZj6dI58nt6PxD+ORy j2KXWuNJC0HUXQjbzX6MmMgJ9oQw/TlzZtK6ulCGi1d31NW6R7PjZcEwOO5gvyfokCux 4Xv5PT/ioo8qMp1Xf9g/uMZktRkVh+LQ705MxBmDJrDgGtlT7JR6f+H9f0OfnK7WER9N C62BPJpKzUVnL4NqJO7+xOBnhbN7tHqmS+Tv02DDMibc9Tg42FeP8CQoXf+HB9e4ibS5 1qag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kQqbXzS9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch12si17679877plb.5.2019.04.30.04.58.15; Tue, 30 Apr 2019 04:58:30 -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=@kernel.org header.s=default header.b=kQqbXzS9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728218AbfD3Lz3 (ORCPT + 99 others); Tue, 30 Apr 2019 07:55:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:36026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730985AbfD3Lt2 (ORCPT ); Tue, 30 Apr 2019 07:49:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 92E382054F; Tue, 30 Apr 2019 11:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624968; bh=0ciGWazNr8j4GuCDsuHETt61WKcUTfQMjk8tZXtymO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQqbXzS98Fs326DGwVXD/a+X0vQcBOJ9Scgz6WPE7HG5yKBmQapTyOBYtOLpvPplT zvRb42WVehskVe4qOMEERwv7HOzphWU4Gj3IV9MZXp4/9YxdLpMfJIsfp/dlyuRGou 1kOzpL1hixzWpmay//acdaRXVCzbtVJWuMCuuNxc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+6f72c20560060c98b566@syzkaller.appspotmail.com, Herbert Xu , Ondrej Mosnacek Subject: [PATCH 5.0 13/89] crypto: xts - Fix atomic sleep when walking skcipher Date: Tue, 30 Apr 2019 13:38:04 +0200 Message-Id: <20190430113610.342144523@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Herbert Xu commit 44427c0fbc09b448b22410978a4ef6ee37599d25 upstream. When we perform a walk in the completion function, we need to ensure that it is atomic. Reported-by: syzbot+6f72c20560060c98b566@syzkaller.appspotmail.com Fixes: 78105c7e769b ("crypto: xts - Drop use of auxiliary buffer") Cc: Signed-off-by: Herbert Xu Acked-by: Ondrej Mosnacek Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/xts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/crypto/xts.c +++ b/crypto/xts.c @@ -137,8 +137,12 @@ static void crypt_done(struct crypto_asy { struct skcipher_request *req = areq->data; - if (!err) + if (!err) { + struct rctx *rctx = skcipher_request_ctx(req); + + rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; err = xor_tweak_post(req); + } skcipher_request_complete(req, err); }