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


Groups > linux.kernel > #1229997

Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Thomas Graf <tgraf@suug.ch>
Newsgroups linux.kernel
Subject Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one
Date Tue, 22 Sep 2015 11:20:02 +0200
Message-ID <qbrTY-12G-7@gated-at.bofh.it> (permalink)
References <qbrAC-qV-21@gated-at.bofh.it>
X-Original-To Dmitry Vyukov <dvyukov@google.com>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=fbYiJxJ0RDatUp6xQofezgCxmxwCCPlI6Qpp5jZ7LIo=; b=b0eGOsaDnfEHf7ROq9L7F68/vtueATQuT1oUnUsvTuUhhDKDXgfyQ7FnuPnbk/F6Uk jqY2Es93Osi8T6KQ6smfjzfJVxZJkOqHeD5Suf9T0Pr/lkLJnX7WiPOleb17ENydlsKI IeGQc1BOV0rKvVC+lWH1EDI9j1J1axkp/esnX8CUm+A7D/sikO2jn6wMsPZBca1MZzc3 +n4lJWkiIVSRa21XJcJzCIonRpvbvVdb7G5Cjf0QVkSK2X2R5xZ4cJZmOWmGq0tuHSaa q8DVCTJud+V/dvgKWOOjxZ2igTYv85zFvn5lEkGtOxpIC1BVZc1N5dwMfzRGcrqyQGdz jkeQ==
X-Gm-Message-State ALoCoQnNHc1b3U55XUf0S9BLhng83vr6z2LTZlvLruoMYvZ2VFfnnDQNdRRZjHQyAw2LHYZLYlb7
X-Received by 10.194.93.35 with SMTP id cr3mr27613199wjb.46.1442913459891; Tue, 22 Sep 2015 02:17:39 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 27
Organization linux.* mail to news gateway
X-Original-Cc eric.dumazet@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kcc@google.com, andreyknvl@google.com, glider@google.com, ktsan@googlegroups.com, paulmck@linux.vnet.ibm.com
X-Original-Date Tue, 22 Sep 2015 11:17:38 +0200
X-Original-Message-ID <20150922091738.GD13047@pox.localdomain>
X-Original-References <1442911912-66882-1-git-send-email-dvyukov@google.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1229997

Show key headers only | View raw


On 09/22/15 at 10:51am, Dmitry Vyukov wrote:
> rhashtable_rehash_one() uses complex logic to update entry->next field,
> after INIT_RHT_NULLS_HEAD and NULLS_MARKER expansion:
> 
> entry->next = 1 | ((base + off) << 1)
> 
> This can be compiled along the lines of:
> 
> entry->next = base + off
> entry->next <<= 1
> entry->next |= 1
> 
> Which will break concurrent readers.
> 
> NULLS value recomputation is not needed here, so just remove
> the complex logic.
> 
> The data race was found with KernelThreadSanitizer (KTSAN).
> 
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>

Acked-by: Thomas Graf <tgraf@suug.ch>
--
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

[PATCH v2] lib: fix data race in rhashtable_rehash_one Dmitry Vyukov <dvyukov@google.com> - 2015-09-22 11:00 +0200
  Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one Eric Dumazet <eric.dumazet@gmail.com> - 2015-09-22 11:10 +0200
  Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one Thomas Graf <tgraf@suug.ch> - 2015-09-22 11:20 +0200
  Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-22 17:30 +0200
  Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one David Miller <davem@davemloft.net> - 2015-09-23 02:40 +0200

csiph-web