From: David Howells <dhowells@redhat.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: dhowells@redhat.com, christophe.jaillet@wanadoo.fr,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] KASAN: null-ptr-deref Read in __free_pages
Date: Mon, 21 Mar 2022 09:37:57 +0000 [thread overview]
Message-ID: <985901.1647855477@warthog.procyon.org.uk> (raw)
In-Reply-To: <1745593.TLkxdtWsSY@leap>
Fabio M. De Francesco <fmdefrancesco@gmail.com> wrote:
> I cannot have any objection, it's up to you to decide :)
Of course you can object. That's kind of the point of a review;-)
How about the attached instead, then?
David
---
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -271,9 +271,8 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
return 0;
error_p:
- for (i = 0; i < nr_pages; i++)
- if (pages[i])
- __free_page(pages[i]);
+ while (--i >= 0)
+ __free_page(pages[i]);
kfree(pages);
error:
(void) account_pipe_buffers(pipe->user, nr_pages, pipe->nr_accounted);
next prev parent reply other threads:[~2022-03-21 9:38 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 [this message]
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
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=985901.1647855477@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=fmdefrancesco@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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