Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3525484pxj; Mon, 24 May 2021 08:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC3SJfqDfWReb/1MfDWdcIwrPFQ1/C5d6Da3hmngef/oFSq4cocdcyU9VmkTvLes73AkVf X-Received: by 2002:a6b:3c1a:: with SMTP id k26mr16146999iob.113.1621870753973; Mon, 24 May 2021 08:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621870753; cv=none; d=google.com; s=arc-20160816; b=Lo2oCDTdNgxqClAV1KdY8w+Whgak+zo9zldloqupyqaY3yQsp9rZkaadnQ3X1eBG+A KJelnyh43WNKTg3FwfLs8WyU8vkSKWrxbbkYixWYipSNOgn8C4CIOdfZsBAJwpmqSx3t u27ioDCUIFzsBDkhqJBPa8qLO4TxfqYz2npuR92By+LCxT5/WDhR4FIaLTW6b4ttPBk0 yDxar7guvMB0xG+Dmt5QbHvS/43Hsf2wYDiWwgYGnkrVxVyLDR1iSi+rLRWm3rF5Y4ky yNQhbd0he0Hkqoaux/vRBDi5Q3RNbN71qUy+3MawVxjYybcoCH1R5xDVWXrqXoIChh9n 4s9Q== 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=QcJR4N/YyaEzX27oXRGtAiIDvG1XIAtX7JOgmjUPyhY=; b=IK/sq2CQ0jfYuuKWfTT7TiA7V2VBUy91v+DeyowtkVGbC7bIa6hJF47qc9qVGvyyoU +9SYJz2uBLVlbTMp2GRtcOEABAhYwJBcmYSP5pAWrZZrqbOCpzlKo3Xf8on6y/Bxhb17 OB7AkoBLdq9ZQj6TlN9jGqd39DGNxzMsrb9KMKaojaEXeYktHMOqp/By+4KaeuTT5zaC S6M+4C4XABGU30HuAn8PPWkO8baRJDNrcgc4zdpVwBl2FDMBFFfDldtNjGW0Z7ctRtFS pPpTkp7jwyOH4x6jMeemXs/+NB0rp2wOC92OJXtHabYY5YnDsXTBv1b2muRBsG6d00o2 7igw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aBBtIQGR; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si15212550ilj.58.2021.05.24.08.39.00; Mon, 24 May 2021 08:39:13 -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=@linuxfoundation.org header.s=korg header.b=aBBtIQGR; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233794AbhEXPiQ (ORCPT + 99 others); Mon, 24 May 2021 11:38:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:50520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233144AbhEXPej (ORCPT ); Mon, 24 May 2021 11:34:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE589613B0; Mon, 24 May 2021 15:32:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870327; bh=mMX5HUHTtWOlzHb1E9m+WAkJkVryMLyaA+OR+Mk+fqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aBBtIQGRUOQwR3sQeY3NzAeuuLuUsWaaMws1vfLXhtOPZnzLL/hykgmyg1atNMAcW 2ts4OMlOn+nt+KSmkOA/DATna9LAV29MNbuqAne3JT9Wn2141YL3giHpdPmrPlJxpV nAnK0RhEbAbD4I5HOslGKccRGIG6fUzn6RVQewhs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aditya Pakki , Tyler Hicks Subject: [PATCH 4.9 20/36] Revert "ecryptfs: replace BUG_ON with error handling code" Date: Mon, 24 May 2021 17:25:05 +0200 Message-Id: <20210524152324.810794391@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.158146731@linuxfoundation.org> References: <20210524152324.158146731@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: Greg Kroah-Hartman commit e1436df2f2550bc89d832ffd456373fdf5d5b5d7 upstream. This reverts commit 2c2a7552dd6465e8fde6bc9cccf8d66ed1c1eb72. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change. The original commit log for this change was incorrect, no "error handling code" was added, things will blow up just as badly as before if any of these cases ever were true. As this BUG_ON() never fired, and most of these checks are "obviously" never going to be true, let's just revert to the original code for now until this gets unwound to be done correctly in the future. Cc: Aditya Pakki Fixes: 2c2a7552dd64 ("ecryptfs: replace BUG_ON with error handling code") Cc: stable Acked-by: Tyler Hicks Link: https://lore.kernel.org/r/20210503115736.2104747-49-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- fs/ecryptfs/crypto.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -339,10 +339,8 @@ static int crypt_scatterlist(struct ecry struct extent_crypt_result ecr; int rc = 0; - if (!crypt_stat || !crypt_stat->tfm - || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)) - return -EINVAL; - + BUG_ON(!crypt_stat || !crypt_stat->tfm + || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)); if (unlikely(ecryptfs_verbosity > 0)) { ecryptfs_printk(KERN_DEBUG, "Key size [%zd]; key:\n", crypt_stat->key_size);