All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	syzbot+41f9c04b50ef70c66947@syzkaller.appspotmail.com,
	christian.brauner@ubuntu.com, David Miller <davem@davemloft.net>,
	David Ahern <dsahern@gmail.com>, Florian Westphal <fw@strlen.de>,
	Jiri Benc <jbenc@redhat.com>, Kirill Tkhai <ktkhai@virtuozzo.com>,
	LKML <linux-kernel@vger.kernel.org>,
	lucien xin <lucien.xin@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	syzkaller-bugs@googlegroups.com
Subject: Re: KASAN: use-after-free Read in rtnetlink_put_metrics
Date: Wed, 1 Aug 2018 10:15:37 +0200	[thread overview]
Message-ID: <20180801081537.GA31982@bistromath.localdomain> (raw)
In-Reply-To: <CAM_iQpURKOMAaPfs9v7FzhqqQPzj71sQD2LS0eU8cuqTML-YoA@mail.gmail.com>

2018-07-31, 16:03:13 -0700, Cong Wang wrote:
> On Tue, Jul 31, 2018 at 6:41 AM Sabrina Dubroca <sd@queasysnail.net> wrote:
> >
> > 2018-07-31, 05:41:56 -0700, Eric Dumazet wrote:
> > >
> > >
> > > On 07/31/2018 05:31 AM, syzbot wrote:
> > > > Hello,
> > > >
> > > > syzbot found the following crash on:
> > > >
> > > > HEAD commit:    61f4b23769f0 netlink: Don't shift with UB on nlk->ngroups
> > > > git tree:       net
> > > > console output: https://syzkaller.appspot.com/x/log.txt?x=14a9de58400000
> > > > kernel config:  https://syzkaller.appspot.com/x/.config?x=ffb4428fdc82f93b
> > > > dashboard link: https://syzkaller.appspot.com/bug?extid=41f9c04b50ef70c66947
> > > > compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
> > > >
> > > > Unfortunately, I don't have any reproducer for this crash yet.
> > [...]
> >
> > > Probably also caused by :
> > >
> > >
> > > commit df18b50448fab1dff093731dfd0e25e77e1afcd1
> > > Author: Sabrina Dubroca <sd@queasysnail.net>
> > > Date:   Mon Jul 30 16:23:10 2018 +0200
> > >
> > >     net/ipv6: fix metrics leak
> >
> > Yeah, I'm looking into both those reports :/
> 
> Looks like this commit is completely unnecessary,
> fib6_drop_pcpu_from() calls fib6_info_release()
> which calls fib6_info_destroy_rcu(), so this metrics
> will be released twice...

kmemleak disagrees:

unreferenced object 0xffff88006b605080 (size 96):
  comm "ip", pid 433, jiffies 4294889793 (age 74.844s)
  hex dump (first 32 bytes):
    00 00 00 00 f4 01 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000002650e4e2>] ip6_route_info_create+0x770/0x4050
    [<000000000a8d4c52>] ip6_route_add+0x18/0x90
    [<00000000474d669c>] inet6_rtm_newroute+0xeb/0x100
    [<0000000019fb732d>] rtnetlink_rcv_msg+0x3b5/0xb40
    [<000000006f891e19>] netlink_rcv_skb+0x137/0x380
    [<0000000070451985>] netlink_unicast+0x47f/0x6e0
    [<000000004487d656>] netlink_sendmsg+0x7a7/0x10c0
    [<0000000089fdf5ae>] sock_sendmsg+0xac/0x160
    [<00000000aae19c54>] ___sys_sendmsg+0x6e0/0xbb0
    [<00000000a3906352>] __sys_sendmsg+0xdc/0x230
    [<00000000c7c8548a>] do_syscall_64+0x15d/0x740
    [<000000007dfdad73>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [<000000003adb705a>] 0xffffffffffffffff


ip netns add peerA
ip link add eth0 netns peerA type veth peer name ethA
ip -net peerA link set eth0 up
ip -net peerA link set lo up
ip -net peerA a a fec0:A::1/64 dev eth0
ip -net peerA route add fec0:B::/64 via fec0:A:: mtu 1300

ip netns exec peerA nc fec0:B::1 1234

ip -net peerA route del fec0:B::/64
ip netns del peerA

-- 
Sabrina

  reply	other threads:[~2018-08-01  8:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 12:31 KASAN: use-after-free Read in rtnetlink_put_metrics syzbot
2018-07-31 12:41 ` Eric Dumazet
2018-07-31 13:40   ` Sabrina Dubroca
2018-07-31 21:53     ` David Miller
2018-07-31 23:03     ` Cong Wang
2018-08-01  8:15       ` Sabrina Dubroca [this message]
2018-08-01  8:28         ` David Ahern
2018-08-02  5:23         ` Cong Wang
2018-08-01 18:46       ` David Miller
2018-08-01 19:26         ` Sabrina Dubroca

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=20180801081537.GA31982@bistromath.localdomain \
    --to=sd@queasysnail.net \
    --cc=christian.brauner@ubuntu.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fw@strlen.de \
    --cc=jbenc@redhat.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+41f9c04b50ef70c66947@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.