Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3533119pxj; Mon, 24 May 2021 08:49:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZISD+mYJDWq0tu0cTW/OfWB6But7EMGXFC9bXlnb/cMFDqpiHCv925JokeBOq8jbVJga7 X-Received: by 2002:a05:6e02:1541:: with SMTP id j1mr17697916ilu.146.1621871396163; Mon, 24 May 2021 08:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871396; cv=none; d=google.com; s=arc-20160816; b=lJ8oAwzaJ0ThhgunKeVpUc5LJXjFKp+zAUr/BciFux31JSOZw5dIPt0mL+htQ0KCrx F0xEwRTa2y8duJtDZHcNInOfcsmmH4hsMntgwymfJzceFcM/QHYQrqaBah7Yr1qm82rP XvMqoodQp+PokUmWKZfZPwA6iOSMovfrDU+PpdGiRntrhrxI2T+m8tmKRyglIDzY4PBT tDDDCcdV8CyKvlQ0GlIBJCOLcV3BbFC+IQCF1HXE+pFYE0oevON3ikJOCnfpbD7QqUJI GbU24jhA3Z5CifHUbZDCZAiH+Y3ivwCE0ZluW++7eaHseO2QWo7+sfmYdHwIKeFxIQip Pk3w== 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=IvNp90fcQJFJmhz4XQWyiSJHznXmjwb9kVb7lmyYilE=; b=Z5Isa7Hd0p6xMfhid0zWE6s2kIOuX05cRpWiefHS6SOAC37gEfxVoPQUGhuGcSIoka S1asB2489NnODLRMJhav1sPDjlv1UDgP4yv2dQi+9rF46UGOmMakUSTZ8D1GTcQ4oQhy c3zPGHhxTYeYWj0R8bcU0lAWko0+3KMYnDAL7uCrkNeXcIbkZ7LzYgmrHx2eeObUqLx9 UJ7rvEx8YeHlqCdoONvHeU7pewM6MpISoqnQ9y1j4utt/3pkmHPT8S8iZbbzhNo1aNUu EbXgO68iXKzEkd3ZYJYFMZPQ01DURLJAZOBWn4mQ9FurOjKWHqGiei8LqGtRCE1ahu69 awFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QpjpBXU7; 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 w12si15085680ill.144.2021.05.24.08.49.43; Mon, 24 May 2021 08:49:56 -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=QpjpBXU7; 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 S233991AbhEXPsu (ORCPT + 99 others); Mon, 24 May 2021 11:48:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:56932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbhEXPnF (ORCPT ); Mon, 24 May 2021 11:43:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BFB3661446; Mon, 24 May 2021 15:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870512; bh=ogFyHBqwc8cEz8KsA8L6Q+Hn9skW7uqjYdcqmyQVW4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpjpBXU7gF3/rJfK1ZCG9wltyI1d6pIKWQBrN+reQy4s7F338nLikDCzrzLIVskuA k4XPTM3BsFM3/WAadZyDntu5dB2xgTSQj+pz9CVsspY5cFVgPb0ZpUbgQsUqsNkLA4 z6/mZ4EuB4ij1XdcXzSVXioq/ipdb4Q9gGDvQIoc= 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.19 30/49] Revert "ecryptfs: replace BUG_ON with error handling code" Date: Mon, 24 May 2021 17:25:41 +0200 Message-Id: <20210524152325.354855859@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.382084875@linuxfoundation.org> References: <20210524152324.382084875@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 @@ -325,10 +325,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);