From: Eric Dumazet <eric.dumazet@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH net] ax25: fix possible use-after-free
Date: Wed, 23 Jan 2019 15:42:41 -0800 [thread overview]
Message-ID: <0dd7561b-533c-5054-816c-38fa8e9fae5f@gmail.com> (raw)
In-Reply-To: <CAM_iQpXoPGFj=ey7_aYKhhfPdL1SMxQj=adydxVYqwPJhBOSpg@mail.gmail.com>
On 01/23/2019 03:25 PM, Cong Wang wrote:
> On Tue, Jan 22, 2019 at 10:41 AM 'Eric Dumazet' via syzkaller
> <syzkaller@googlegroups.com> wrote:
>>
>> syzbot found that ax25 routes where not properly protected
>> against concurrent use [1].
>>
>> In this particular report the bug happened while
>> copying ax25->digipeat.
>>
>> Fix this problem by making sure we call ax25_get_route()
>> while ax25_route_lock is held, so that no modification
>> could happen while using the route.
>
> ax25_route_lock_use() is a read lock, so two ax25_rt_autobind()
> could still enter the same critical section?
>
Not sure I understand your concern.
The two ax25_rt_autobind() would only read the route contents,
so that should be fine ?
>
>>
>> The current two ax25_get_route() callers do not sleep,
>> so this change should be fine.
>>
>> Once we do that, ax25_get_route() no longer needs to
>> grab a reference on the found route.
> .
>
> After your patch, ax25_hold_route() has no callers while
> ax25_put_route() still does. Is ->refcount always 1?
Yes, the plan is to remove this refcount in net-next.
next prev parent reply other threads:[~2019-01-23 23:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 18:40 [PATCH net] ax25: fix possible use-after-free Eric Dumazet
2019-01-23 19:18 ` David Miller
2019-01-23 23:25 ` Cong Wang
2019-01-23 23:42 ` Eric Dumazet [this message]
2019-01-24 1:12 ` Cong Wang
2019-01-24 1:44 ` Eric Dumazet
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=0dd7561b-533c-5054-816c-38fa8e9fae5f@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=syzkaller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox