public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: syzbot <syzbot+d55757faa9b80590767b@syzkaller.appspotmail.com>,
	syzkaller-bugs@googlegroups.com
Cc: dhowells@redhat.com, christophe.jaillet@wanadoo.fr,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	David Howells <dhowells@redhat.com>
Subject: Re: [syzbot] KASAN: null-ptr-deref Read in __free_pages
Date: Mon, 21 Mar 2022 09:50:05 +0100	[thread overview]
Message-ID: <1905446.yKVeVyVuyW@leap> (raw)
In-Reply-To: <970502.1647851062@warthog.procyon.org.uk>

On lunedì 21 marzo 2022 09:24:22 CET David Howells wrote:
> It should be possible to just test for the pointer being NULL in the loop
> before calling __free_pages() since the list was allocated with kcalloc().
> 
> David
> 
> #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git 6d39b096627f0a1eb6e14f049d8ae3c93e0290f2
> 
> -- 
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/970502.1647851062%40warthog.procyon.org.uk.
> 
This way you are doing two test for each iteration of the loop that calls
__free_pages(). One for the index "i" to stay less that an unnecessary 
high limit, the other for pages[i] being NULL.

However, since you are the Maintainer, yours are the rules :)

Regards,

Fabio M. De Francesco




  parent reply	other threads:[~2022-03-21  8:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 22:04 [syzbot] KASAN: null-ptr-deref Read in __free_pages syzbot
2022-03-20 23:32 ` Fabio M. De Francesco
2022-03-20 23:38   ` syzbot
2022-03-20 23:40 ` Fabio M. De Francesco
2022-03-20 23:50   ` syzbot
2022-03-21  0:28 ` Fabio M. De Francesco
2022-03-21  0:37   ` syzbot
2022-03-21  8:46   ` David Howells
2022-03-21  9:02     ` Fabio M. De Francesco
2022-03-21  9:37       ` David Howells
2022-03-21  8:24 ` David Howells
2022-03-21  8:34   ` syzbot
2022-03-21  8:43   ` Fabio M. De Francesco
2022-03-21  8:50   ` Fabio M. De Francesco [this message]
2022-03-21 11:19 ` David Howells
2022-03-21 11:30   ` syzbot

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=1905446.yKVeVyVuyW@leap \
    --to=fmdefrancesco@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+d55757faa9b80590767b@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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