Re: [PATCH] scsi: message: fusion: Fix a possible data race in mpt_ioc_reset()

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

 



On 10/24/23 00:27, Tuo Li wrote:
In my opinion, this may be a harmful race, because the value of
ioc->taskmgmt_quiesce_io can be rewritten by mpt_ioc_reset() when
another thread is accessing it.

It is a common pattern in the Linux kernel that a variable is set from
one thread without using locking and is read by another thread that is
holding a lock. It should be sufficient here to use WRITE_ONCE(). I
don't think that acquiring and releasing the spin lock is required.

Thanks,

Bart.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux