From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABEA6C433ED for ; Wed, 21 Apr 2021 16:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71F666144B for ; Wed, 21 Apr 2021 16:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244216AbhDUQEl (ORCPT ); Wed, 21 Apr 2021 12:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235921AbhDUQEj (ORCPT ); Wed, 21 Apr 2021 12:04:39 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D18DC06174A for ; Wed, 21 Apr 2021 09:04:06 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lZFKc-0074PF-0u; Wed, 21 Apr 2021 16:04:02 +0000 Date: Wed, 21 Apr 2021 16:04:02 +0000 From: Al Viro To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Aditya Pakki , Tyler Hicks Subject: Re: [PATCH 053/190] Revert "ecryptfs: replace BUG_ON with error handling code" Message-ID: References: <20210421130105.1226686-1-gregkh@linuxfoundation.org> <20210421130105.1226686-54-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421130105.1226686-54-gregkh@linuxfoundation.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 02:58:48PM +0200, Greg Kroah-Hartman wrote: > This reverts commit 2c2a7552dd6465e8fde6bc9cccf8d66ed1c1eb72. > > Commits from @umn.edu addresses have been found to be submitted in "bad > faith" to try to test the kernel community's ability to review "known > malicious" changes. The result of these submissions can be found in a > paper published at the 42nd IEEE Symposium on Security and Privacy > entitled, "Open Source Insecurity: Stealthily Introducing > Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University > of Minnesota) and Kangjie Lu (University of Minnesota). > > Because of this, all submissions from this group must be reverted from > the kernel tree and will need to be re-reviewed again to determine if > they actually are a valid fix. Until that work is complete, remove this > change to ensure that no problems are being introduced into the > codebase. FWIW, commit message on the original ( ecryptfs: replace BUG_ON with error handling code In crypt_scatterlist, if the crypt_stat argument is not set up correctly, the kernel crashes. Instead, by returning an error code upstream, the error is handled safely. The issue is detected via a static analysis tool written by us. Fixes: 237fead619984 (ecryptfs: fs/Makefile and fs/Kconfig) Signed-off-by: Aditya Pakki Signed-off-by: Tyler Hicks ) really stinks. First, the analysis: condition being tested is (!crypt_stat || !crypt_stat->tfm || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)) and their patch replaces BUG_ON() with return of -EINVAL. So the only thing their tool had detected the presence of BUG_ON(). Was it grep, by any chance? IOW, the commit message is "we'd found BUG_ON(); let's replace it with returning some error value and hope everything works. Whaddya mean, how do we know? Our tool [git grep BUG_ON, that is] says it's there and look, it *is* there, so if it's ever reached there'll be trouble. What, assertion that returning an error will be handled safely? 'Cuz we saiz so, that's why" It *is* functionally harmless, AFAICS, but only because the condition is really impossible. However, * it refers to vague (s)tool they'd produced, nevermind that all they really do is "find BUG_ON(), replace with returning an error". * unlike BUG_ON(), the replacement does *NOT* document the fact that condition should be impossible. IMO either should be sufficient for rejecting the patch.