Re: [PATCH] sbitmap: order RW on old associated instance and setting clear bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ming

On 3/19/19 12:24 PM, Ming Lei wrote:
> @@ -591,6 +591,15 @@ EXPORT_SYMBOL_GPL(sbitmap_queue_wake_up);
>  void sbitmap_queue_clear(struct sbitmap_queue *sbq, unsigned int nr,
>  			 unsigned int cpu)
>  {
> +	/*
> +	 * Once the clear bit is set, it will be visible to allocation
> +	 * side.
> +	 *
> +	 * This memory barrier orders any READ/WRITE on the to-be-freed
> +	 * asssociated instance for avoiding potential use-after-free, and
> +	 * its pair is the memory barrier implied in sbitmap_get().
which one ?

> +	 */
> +	smp_mb();

smp_mb_before_atomic should be enough.

>  	sbitmap_deferred_clear_bit(&sbq->sb, nr);

Thanks
Jianchao



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux