linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
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 <zealci@zte.com.cn>,
	syzbot+6a5a7672f663cce8b156@syzkaller.appspotmail.com,
	Songyi Zhang <zhang.songyi@zte.com.cn>,
	Yang Yang <yang.yang29@zte.com.cn>,
	Jiang Xuexin <jiang.xuexin@zte.com.cn>,
	Zhang wenya <zhang.wenya1@zte.com.cn>
Subject: Re: [PATCH] fs/ntfs: fix BUG_ON of ntfs_read_block()
Date: Thu, 23 Jun 2022 09:57:39 +0200	[thread overview]
Message-ID: <YrQc8xq+QezRcLi7@kroah.com> (raw)
In-Reply-To: <20220623035131.974098-1-xu.xin16@zte.com.cn>

On Thu, Jun 23, 2022 at 03:51:31AM +0000, cgel.zte@gmail.com wrote:
> From: xu xin <xu.xin16@zte.com.cn>
> 
> 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 <zealci@zte.com.cn>
> Reported-by: syzbot+6a5a7672f663cce8b156@syzkaller.appspotmail.com
> Reviewed-by: Songyi Zhang <zhang.songyi@zte.com.cn>
> Reviewed-by: Yang Yang <yang.yang29@zte.com.cn>
> Reviewed-by: Jiang Xuexin<jiang.xuexin@zte.com.cn>
> Reviewed-by: Zhang wenya<zhang.wenya1@zte.com.cn>
> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
> ---
>  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");
> +		unlock_page(page);
> +		return -EINVAL;
> +	}
>  
>  	blocksize = vol->sb->s_blocksize;
>  	blocksize_bits = vol->sb->s_blocksize_bits;
> -- 
> 2.25.1
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

  parent reply	other threads:[~2022-06-23  7:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  3:36 Bug report: ntfs_read_block may crash system xu xin
2022-06-23  3:51 ` [PATCH] fs/ntfs: fix BUG_ON of ntfs_read_block() cgel.zte
2022-06-23  7:57   ` Greg KH
2022-06-23  8:57     ` CGEL
2022-06-23  7:57   ` Greg KH [this message]
2022-06-23  8:59     ` CGEL
2022-06-23  7:55 ` Bug report: ntfs_read_block may crash system Greg KH
2022-06-23  9:49 ` [PATCH v2] fs/ntfs: fix BUG_ON of ntfs_read_block() cgel.zte
2022-06-23 17:08   ` Eric Biggers
2022-06-24  2:33     ` Namjae Jeon
2022-06-24  3:55       ` CGEL
     [not found]       ` <7FBC6FD2-5D60-4EB8-96D5-A6014D271950@tuxera.com>
2022-06-24 14:37         ` Namjae Jeon
2022-06-24 15:26           ` Anton Altaparmakov
2022-07-05  7:47             ` CGEL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrQc8xq+QezRcLi7@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=anton@tuxera.com \
    --cc=cgel.zte@gmail.com \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+6a5a7672f663cce8b156@syzkaller.appspotmail.com \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    --cc=zealci@zte.com.cn \
    --cc=zhang.songyi@zte.com.cn \
    --cc=zhang.wenya1@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).