linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qiujun Huang <anenbupt@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: syzbot <syzbot+4a88b2b9dc280f47baf4@syzkaller.appspotmail.com>,
	aeb@cwi.nl, danarag@gmail.com, kstewart@linuxfoundation.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	tglx@linutronix.de, viro@zeniv.linux.org.uk,
	Qiujun Huang <hqjagain@gmail.com>
Subject: Re: KASAN: null-ptr-deref Write in get_block
Date: Mon, 23 Mar 2020 20:18:03 +0800	[thread overview]
Message-ID: <CADG63jAtF8RidQmeeSw7kC0Vzw2qSEeRYz+HEAKHhLFx7j=Zow@mail.gmail.com> (raw)
In-Reply-To: <20200323114225.GE26299@kadam>

On Mon, Mar 23, 2020 at 7:42 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Fix the subject to [PATCH] minix: Fix NULL dereference in alloc_branch()
>
> On Sun, Mar 22, 2020 at 08:06:48PM +0800, Qiujun Huang wrote:
> > Need to check the return value of sb_getblk.
> >
>
> Add a Reported-by tag.
>
> Reported-by: syzbot+4a88b2b9dc280f47baf4@syzkaller.appspotmail.com
>
> > Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> > ---
> >  fs/minix/itree_common.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/fs/minix/itree_common.c b/fs/minix/itree_common.c
> > index 043c3fd..eedd79f 100644
> > --- a/fs/minix/itree_common.c
> > +++ b/fs/minix/itree_common.c
> > @@ -85,6 +85,8 @@ static int alloc_branch(struct inode *inode,
> >   break;
> >   branch[n].key = cpu_to_block(nr);
> >   bh = sb_getblk(inode->i_sb, parent);
> > + if (!bh)
> > + break;
>
> The patch is white space damaged and we need to do a bit of error
> handling before the break as well.

I get it, thanks.

>
>         bh = sb_getblk(inode->i_sb, parent);
> +       if (!bh) {
> +               minix_free_block(inode, block_to_cpu(branch[n].key));
> +               break;
> +       }
>         lock_buffer(bh);
>
> Please fix those few things and resend.
>
> regards,
> dan carpenter
>

      reply	other threads:[~2020-03-23 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 10:10 KASAN: null-ptr-deref Write in get_block syzbot
2020-03-22 12:06 ` Qiujun Huang
2020-03-23 11:42   ` Dan Carpenter
2020-03-23 12:18     ` Qiujun Huang [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='CADG63jAtF8RidQmeeSw7kC0Vzw2qSEeRYz+HEAKHhLFx7j=Zow@mail.gmail.com' \
    --to=anenbupt@gmail.com \
    --cc=aeb@cwi.nl \
    --cc=dan.carpenter@oracle.com \
    --cc=danarag@gmail.com \
    --cc=hqjagain@gmail.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+4a88b2b9dc280f47baf4@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /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).