From: Dominique Martinet <asmadeus@codewreck.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: syzbot <syzbot+d4252148d198410b864f@syzkaller.appspotmail.com>,
David Miller <davem@davemloft.net>,
Eric Van Hensbergen <ericvh@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Latchesar Ionkov <lucho@ionkov.net>,
netdev <netdev@vger.kernel.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
v9fs-developer@lists.sourceforge.net
Subject: Re: KASAN: invalid-free in p9stat_free
Date: Tue, 28 Aug 2018 00:40:37 +0200 [thread overview]
Message-ID: <20180827224037.GA18923@nautica> (raw)
In-Reply-To: <CACT4Y+b1B5_Eg+j91GxaVbPk5sb8+SVOU_z5k9HYb4R716X9kQ@mail.gmail.com>
Dmitry Vyukov wrote on Mon, Aug 27, 2018:
> kfree and then null pointer is pretty common, try to run:
>
> find -name "*.c" -exec grep -A 1 "kfree(" {} \; | grep -B 1 " = NULL;"
Hmm, right, it looks like somewhere between 5 and 10% of the kfree()
calls are followed by NULL assignment, that's "common enough" - not
generalized but not rare either.
> Leaving dangling pointers behind is not the best idea.
> And from what I remember a bunch of similar double frees were fixed by
> nulling the pointer after the first kfree.
In this case it really is an error to call p9stat_free again, so let's
just do both.
Will send the patches shortly.
Thanks,
--
Dominique
next prev parent reply other threads:[~2018-08-27 22:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-26 13:50 KASAN: invalid-free in p9stat_free syzbot
2018-08-27 5:24 ` Dominique Martinet
2018-08-27 14:25 ` Dmitry Vyukov
2018-08-27 22:40 ` Dominique Martinet [this message]
2018-08-27 22:48 ` [PATCH 1/2] v9fs_dir_readdir: fix double-free on p9stat_read error Dominique Martinet
2018-08-27 22:48 ` [PATCH 2/2] 9p: clear dangling pointers in p9stat_free Dominique Martinet
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=20180827224037.GA18923@nautica \
--to=asmadeus@codewreck.org \
--cc=davem@davemloft.net \
--cc=dvyukov@google.com \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=netdev@vger.kernel.org \
--cc=syzbot+d4252148d198410b864f@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=v9fs-developer@lists.sourceforge.net \
/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).