[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150922151957.GA13278@gondor.apana.org.au>
Date: Tue, 22 Sep 2015 23:19:57 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: eric.dumazet@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, tgraf@...g.ch, kcc@...gle.com,
andreyknvl@...gle.com, glider@...gle.com, ktsan@...glegroups.com,
paulmck@...ux.vnet.ibm.com, dvyukov@...gle.com
Subject: Re: [PATCH v2] lib: fix data race in rhashtable_rehash_one
Dmitry Vyukov <dvyukov@...gle.com> 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@...gle.com>
Acked-by: Herbert Xu <herbert@...dor.apana.org.au>
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists