public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	<ntfs3@lists.linux.dev>
Subject: Re: [PATCH] fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list()
Date: Mon, 8 May 2023 16:48:53 +0400	[thread overview]
Message-ID: <e7c48f38-95bd-e7c6-8fb5-9fa3e85e57bc@paragon-software.com> (raw)
In-Reply-To: <7b10c1aa-0b3a-da0d-ea0e-b135cffc3491@I-love.SAKURA.ne.jp>

On 02.01.2023 18:53, Tetsuo Handa wrote:
> syzbot is reporting too large allocation at ntfs_load_attr_list() [1], for
> a crafted filesystem can have huge data_size.
>
> Link: https://syzkaller.appspot.com/bug?extid=89dbb3a789a5b9711793 [1]
> Reported-by: syzbot <syzbot+89dbb3a789a5b9711793@syzkaller.appspotmail.com>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
>   fs/ntfs3/attrlist.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ntfs3/attrlist.c b/fs/ntfs3/attrlist.c
> index c0c6bcbc8c05..81c22df27c72 100644
> --- a/fs/ntfs3/attrlist.c
> +++ b/fs/ntfs3/attrlist.c
> @@ -52,7 +52,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
>   
>   	if (!attr->non_res) {
>   		lsize = le32_to_cpu(attr->res.data_size);
> -		le = kmalloc(al_aligned(lsize), GFP_NOFS);
> +		le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN);
>   		if (!le) {
>   			err = -ENOMEM;
>   			goto out;
> @@ -80,7 +80,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
>   		if (err < 0)
>   			goto out;
>   
> -		le = kmalloc(al_aligned(lsize), GFP_NOFS);
> +		le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN);
>   		if (!le) {
>   			err = -ENOMEM;
>   			goto out;

I apologize for the delayed response.

Thanks, your patch has been applied.


      parent reply	other threads:[~2023-05-08 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 10:11 [syzbot] [ntfs3?] WARNING in ntfs_load_attr_list syzbot
2023-01-02 14:53 ` [PATCH] fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list() Tetsuo Handa
2023-01-02 20:19   ` Michal Hocko
2023-01-03  0:49     ` Tetsuo Handa
2023-01-03  8:01       ` Michal Hocko
2023-01-03  8:13         ` Michal Hocko
2023-01-17 11:11           ` Tetsuo Handa
2023-05-08 12:48   ` Konstantin Komarov [this message]

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=e7c48f38-95bd-e7c6-8fb5-9fa3e85e57bc@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=ntfs3@lists.linux.dev \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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