Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1229067

Re: [PATCH v4] netlink: Fix autobind race condition that leads to zero port ID

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH v4] netlink: Fix autobind race condition that leads to zero port ID
Date 2015-09-21 08:20 +0200
Message-ID <qb2Cd-6Ly-7@gated-at.bofh.it> (permalink)
References <qa1RU-10h-15@gated-at.bofh.it> <qb2iS-69H-5@gated-at.bofh.it> <qb2sy-6Ac-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 21 Sep 2015 14:06:36 +0800

> On Sun, Sep 20, 2015 at 10:55:21PM -0700, David Miller wrote:
>> From: Herbert Xu <herbert@gondor.apana.org.au>
>> Date: Fri, 18 Sep 2015 19:16:50 +0800
>> 
>> > The commit c0bb07df7d981e4091432754e30c9c720e2c0c78 ("netlink:
>> > Reset portid after netlink_insert failure") introduced a race
>> > condition where if two threads try to autobind the same socket
>> > one of them may end up with a zero port ID.  This led to kernel
>> > deadlocks that were observed by multiple people.
>> > 
>> > This patch reverts that commit and instead fixes it by introducing
>> > a separte rhash_portid variable so that the real portid is only set
>> > after the socket has been successfully hashed.
>> > 
>> > Fixes: c0bb07df7d98 ("netlink: Reset portid after netlink_insert failure")
>> > Reported-by: Tejun Heo <tj@kernel.org>
>> > Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
>> > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>> 
>> Applied and queued up for -stable, thanks Herbert.
> 
> Sorry but Dave but there are still races with v4 as Tejun pointed
> out.  I'm still working on it and I could post them as incremental
> patches if that's the easiest.

Oops, sorry about that.

Yeah at this point incremental patches work the best.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Possible netlink autobind regression Tejun Heo <tj@kernel.org> - 2015-09-17 04:30 +0200
  Re: Possible netlink autobind regression Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-17 05:10 +0200
    Re: Possible netlink autobind regression Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-17 05:50 +0200
      Re: Possible netlink autobind regression Cong Wang <cwang@twopensource.com> - 2015-09-17 07:10 +0200
        Re: Possible netlink autobind regression Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-17 07:20 +0200
          Re: Possible netlink autobind regression Tejun Heo <tj@kernel.org> - 2015-09-17 13:40 +0200
            [PATCH v3] netlink: Fix autobind race condition that leads to zero  port ID Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-18 08:40 +0200
              [PATCH v4] netlink: Fix autobind race condition that leads to zero  port ID Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-18 13:20 +0200
                Re: [PATCH v4] netlink: Fix autobind race condition that leads to  zero port ID David Miller <davem@davemloft.net> - 2015-09-21 08:00 +0200
                Re: [PATCH v4] netlink: Fix autobind race condition that leads to  zero port ID Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-21 08:10 +0200
                Re: [PATCH v4] netlink: Fix autobind race condition that leads to  zero port ID David Miller <davem@davemloft.net> - 2015-09-21 08:20 +0200
                netlink: Replace rhash_portid with bound Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-21 15:40 +0200
                Re: netlink: Replace rhash_portid with bound Tejun Heo <tj@kernel.org> - 2015-09-21 20:30 +0200
                [PATCH v2] netlink: Replace rhash_portid with bound Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-22 05:40 +0200
                [PATCH] netlink: Replace rhash_portid with load_acquire protected  boolean Tejun Heo <tj@kernel.org> - 2015-09-21 23:00 +0200
              Re: [PATCH v3] netlink: Fix autobind race condition that leads to  zero port ID Tejun Heo <tj@kernel.org> - 2015-09-18 15:40 +0200
          Re: Possible netlink autobind regression Thomas Graf <tgraf@suug.ch> - 2015-09-17 13:50 +0200

csiph-web