All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	syzbot <syzkaller@googlegroups.com>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH net] wireguard: fix use-after-free in root_remove_peer_lists
Date: Mon, 3 Feb 2020 10:17:57 -0800	[thread overview]
Message-ID: <efaa70a3-5c71-3cc0-ffe4-e8401d598992@gmail.com> (raw)
In-Reply-To: <CAHmME9r3bROD=jAH-598_DU_RUxQECiqC6sw=spdQvHQiiwf=g@mail.gmail.com>



On 2/3/20 9:29 AM, Jason A. Donenfeld wrote:
> Hi Eric,
> 
> On Mon, Feb 3, 2020 at 6:19 PM Eric Dumazet <edumazet@google.com> wrote:
>> diff --git a/drivers/net/wireguard/allowedips.c b/drivers/net/wireguard/allowedips.c
>> index 121d9ea0f13584f801ab895753e936c0a12f0028..3725e9cd85f4f2797afd59f42af454acc107aa9a 100644
>> --- a/drivers/net/wireguard/allowedips.c
>> +++ b/drivers/net/wireguard/allowedips.c
>> @@ -263,6 +263,7 @@ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
>>         } else {
>>                 node = kzalloc(sizeof(*node), GFP_KERNEL);
>>                 if (unlikely(!node)) {
>> +                       list_del(&newnode->peer_list);
>>                         kfree(newnode);
>>                         return -ENOMEM;
>>                 }
>> --
>> 2.25.0.341.g760bfbb309-goog
> 
> Thanks, nice catch. I remember switching that code over to using the
> peer_list somewhat recently and embarrassed I missed this. Glad to see
> WireGuard is hooked up to syzkaller.
> 

I will let you work on a lockdep issue that syzbot found :)




WARNING: multiple messages have this Message-ID (diff)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	Eric Dumazet <edumazet@google.com>
Cc: netdev <netdev@vger.kernel.org>,
	syzbot <syzkaller@googlegroups.com>,
	"David S . Miller" <davem@davemloft.net>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH net] wireguard: fix use-after-free in root_remove_peer_lists
Date: Mon, 3 Feb 2020 10:17:57 -0800	[thread overview]
Message-ID: <efaa70a3-5c71-3cc0-ffe4-e8401d598992@gmail.com> (raw)
In-Reply-To: <CAHmME9r3bROD=jAH-598_DU_RUxQECiqC6sw=spdQvHQiiwf=g@mail.gmail.com>



On 2/3/20 9:29 AM, Jason A. Donenfeld wrote:
> Hi Eric,
> 
> On Mon, Feb 3, 2020 at 6:19 PM Eric Dumazet <edumazet@google.com> wrote:
>> diff --git a/drivers/net/wireguard/allowedips.c b/drivers/net/wireguard/allowedips.c
>> index 121d9ea0f13584f801ab895753e936c0a12f0028..3725e9cd85f4f2797afd59f42af454acc107aa9a 100644
>> --- a/drivers/net/wireguard/allowedips.c
>> +++ b/drivers/net/wireguard/allowedips.c
>> @@ -263,6 +263,7 @@ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
>>         } else {
>>                 node = kzalloc(sizeof(*node), GFP_KERNEL);
>>                 if (unlikely(!node)) {
>> +                       list_del(&newnode->peer_list);
>>                         kfree(newnode);
>>                         return -ENOMEM;
>>                 }
>> --
>> 2.25.0.341.g760bfbb309-goog
> 
> Thanks, nice catch. I remember switching that code over to using the
> peer_list somewhat recently and embarrassed I missed this. Glad to see
> WireGuard is hooked up to syzkaller.
> 

I will let you work on a lockdep issue that syzbot found :)



_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2020-02-03 18:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 17:19 [PATCH net] wireguard: fix use-after-free in root_remove_peer_lists Eric Dumazet
2020-02-03 17:19 ` Eric Dumazet
2020-02-03 17:29 ` Jason A. Donenfeld
2020-02-03 17:29   ` Jason A. Donenfeld
2020-02-03 18:17   ` Eric Dumazet [this message]
2020-02-03 18:17     ` Eric Dumazet
2020-02-03 18:20     ` Eric Dumazet
2020-02-03 18:20       ` Eric Dumazet
2020-02-03 18:22       ` Jason A. Donenfeld
2020-02-03 18:22         ` Jason A. Donenfeld
2020-02-03 18:24     ` Jason A. Donenfeld
2020-02-03 18:24       ` Jason A. Donenfeld

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=efaa70a3-5c71-3cc0-ffe4-e8401d598992@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=wireguard@lists.zx2c4.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.