Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp241813pxx; Wed, 28 Oct 2020 03:53:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMk7KixAxCvhTKuTF5/Mde65Y8RTXCsZG0lRQXO5QNAbZo6dMI0EBLEb5Z1Li2tHdAAmRt X-Received: by 2002:a17:906:c2d8:: with SMTP id ch24mr6685838ejb.239.1603882397513; Wed, 28 Oct 2020 03:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603882397; cv=none; d=google.com; s=arc-20160816; b=tNwz45hY1SgIkZg3VOAqhTJir6wblar/CO7JV4sLMsbPH/Hhnv+9WqmzdI0827Falu 9HNUuGjvCkSbzsBiyirnrXbCds8OKJlU3O60f+YE/I4vLtI44kHRSIUuTyQa+xPajG+S IiuLfGGsxJLPHwVrhMwThJuoJJUUmP1deGdps/oP90/dMaTFjqsSoKWgTzD65ELezNbv 3G4/P2z6q6jOzOu4WQteZtLTWDdtTbENdoF1nQzwXMwYR49wwuxrOUZgkILp3NMSB3ua cARKQftItBYD7sJtLNXJe/ssQMA4a9d6j6MEghok4ejZENErsk5exX9Qu2FIbTp4gx4x B8Bg== 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=LSZxaIfo5DDeL8d+Ld/IW3x+uhqhdl6rbWHlfQ7GwDE=; b=iueyU1uWLI0llOmr3Zko8AfsnsTcqus92ic8W1o3Erw5xrdNecASDeC4y4bMZoxA9v UeDnBrDOTYKYqpVfNseIVWRdHQdefSC1YA/Lzz47vs8ftnqfOZgMmV9NZIk+YS9Pqp7T 37THs21poeMh1XnOL128348Dz2C465+qzCrP9FsN/wMO3RWv5yyFsCbwmBMYqKjv7JMp o9BSli6JZV1Gz+27LTqEQjdxN8s9ygOUOW4xQoIhziXjvgsmk3XL44HPODTqfQHK0JW5 2PhUDIUR7x3ZdlL/8wRrg/Oi/hKcrJfi/UjCtv8mbz1zhs/rFIxb/loHN7uN9STf25y5 JLtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F59iYNgk; 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 p90si2749641edd.284.2020.10.28.03.52.55; Wed, 28 Oct 2020 03:53:17 -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=F59iYNgk; 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 S1781154AbgJ0OzC (ORCPT + 99 others); Tue, 27 Oct 2020 10:55:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:50140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1772587AbgJ0OuV (ORCPT ); Tue, 27 Oct 2020 10:50:21 -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 D90F620709; Tue, 27 Oct 2020 14:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810221; bh=UXWVw92xD2IiNl8i0Lbk5m04/x79jJuEpl26RVJC2EI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F59iYNgkXt1CP1zQ54wOu1e1qs3KqM20OguD50fX4Xaf6OgnwIBesY19b8v/IBMPo 7BTVTCH4ZLWHj1t1x6Jmz3NRF/QXwMe/22KiU+CntRASxuJYRcQPnL8E8MF0QpdcD3 S9TFXCWdaBPy8tn0CMuUd82ZMcolOlpIckRMcGUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shyam Prasad N , Pavel Shilovsky , Ronnie Sahlberg , Steve French Subject: [PATCH 5.8 063/633] cifs: Return the error from crypt_message when enc/dec key not found. Date: Tue, 27 Oct 2020 14:46:46 +0100 Message-Id: <20201027135525.652582033@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Shyam Prasad N commit 0bd294b55a5de442370c29fa53bab17aef3ff318 upstream. In crypt_message, when smb2_get_enc_key returns error, we need to return the error back to the caller. If not, we end up processing the message further, causing a kernel oops due to unwarranted access of memory. Call Trace: smb3_receive_transform+0x120/0x870 [cifs] cifs_demultiplex_thread+0xb53/0xc20 [cifs] ? cifs_handle_standard+0x190/0x190 [cifs] kthread+0x116/0x130 ? kthread_park+0x80/0x80 ret_from_fork+0x1f/0x30 Signed-off-by: Shyam Prasad N Reviewed-by: Pavel Shilovsky Reviewed-by: Ronnie Sahlberg CC: Stable Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3924,7 +3924,7 @@ crypt_message(struct TCP_Server_Info *se if (rc) { cifs_server_dbg(VFS, "%s: Could not get %scryption key\n", __func__, enc ? "en" : "de"); - return 0; + return rc; } rc = smb3_crypto_aead_allocate(server);