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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90E56CCA47C for ; Thu, 23 Jun 2022 07:57:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230501AbiFWH5c (ORCPT ); Thu, 23 Jun 2022 03:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230447AbiFWH51 (ORCPT ); Thu, 23 Jun 2022 03:57:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFD34707C; Thu, 23 Jun 2022 00:57:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D2E42B82209; Thu, 23 Jun 2022 07:57:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5316C341C0; Thu, 23 Jun 2022 07:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655971044; bh=cTModWjDLAKg4/iCk6qquG8mUQo6JLZag9BE+ysJ4Gw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QQoCx+8xJq4HLwQOyJN5vCzkmmDPCeoeuQgAehEYQCzTKDqlCEBxIyLN5L1OUFBS0 O3BGV6JYSgqBG0N1DppQgzJtvJBPPJzIgAa35Dx2ClRSb28sOP1xqzmCElr6fAMKH/ TL+btZ+FxkJ56r47Ewqcm77S9Nxg7Jhg9BXpdaY8= Date: Thu, 23 Jun 2022 09:57:21 +0200 From: Greg KH To: cgel.zte@gmail.com Cc: anton@tuxera.com, linux-ntfs-dev@lists.sourceforge.net, stable@vger.kernel.org, linux-kernel@vger.kernel.org, xu.xin16@zte.com.cn, linux-fsdevel@vger.kernel.org, Zeal Robot , syzbot+6a5a7672f663cce8b156@syzkaller.appspotmail.com, Songyi Zhang , Yang Yang , Jiang Xuexin , Zhang wenya Subject: Re: [PATCH] fs/ntfs: fix BUG_ON of ntfs_read_block() Message-ID: References: <20220623033635.973929-1-xu.xin16@zte.com.cn> <20220623035131.974098-1-xu.xin16@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220623035131.974098-1-xu.xin16@zte.com.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2022 at 03:51:31AM +0000, cgel.zte@gmail.com wrote: > From: xu xin > > As the bug description, attckers can use this bug to crash the system > When CONFIG_NTFS_FS is set. > > So remove the BUG_ON, and use WARN and return instead until someone > really solve the bug. > > Reported-by: Zeal Robot > Reported-by: syzbot+6a5a7672f663cce8b156@syzkaller.appspotmail.com > Reviewed-by: Songyi Zhang > Reviewed-by: Yang Yang > Reviewed-by: Jiang Xuexin > Reviewed-by: Zhang wenya > Signed-off-by: xu xin > --- > fs/ntfs/aops.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c > index 5f4fb6ca6f2e..b6fd7e711420 100644 > --- a/fs/ntfs/aops.c > +++ b/fs/ntfs/aops.c > @@ -183,7 +183,11 @@ static int ntfs_read_block(struct page *page) > vol = ni->vol; > > /* $MFT/$DATA must have its complete runlist in memory at all times. */ > - BUG_ON(!ni->runlist.rl && !ni->mft_no && !NInoAttr(ni)); > + if (unlikely(!ni->runlist.rl && !ni->mft_no && !NInoAttr(ni))) { > + WARN(1, "NTFS: ni->runlist.rl, ni->mft_no, and NInoAttr(ni) is null!\n"); So for systems with panic-on-warn, you are still crashing? Why is this WARN() line still needed here? thanks, greg k-h