[dpdk-dev] [PATCH v8 1/4] hash: fix race condition in iterate

Bruce Richardson bruce.richardson at intel.com
Tue Oct 23 10:53:16 CEST 2018


On Mon, Oct 22, 2018 at 11:39:45AM -0700, Yipeng Wang wrote:
> In rte_hash_iterate, the reader lock did not protect the
> while loop which checks empty entry. This created a race
> condition that the entry may become empty when enters
> the lock, then a wrong key data value would be read out.
> 
> This commit reads out the position in the while condition,
> which makes sure that the position will not be changed
> to empty before entering the lock.
> 
> Fixes: f2e3001b53ec ("hash: support read/write concurrency")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Yipeng Wang <yipeng1.wang at intel.com>
> Reported-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
> Acked-by: Dharmik Thakkar <dharmik.thakkar at arm.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson at intel.com>


More information about the dev mailing list