Re: [PATCH 5/7] Btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO

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

 



On Tue, Aug 22, 2017 at 11:46:03PM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@xxxxxx>
> 
> A naked read of the value of an RCU pointer isn't safe. Put the whole
> access in an RCU critical section, not just the pointer dereference.

In this case it is safe, as the device will not go away (and potentially
free dev->name) because it's under the device_list_mutex.

The locking around devices and related structures is not exactly
straightforward, but here I don't think we need to stick to the RCU
pattern if the protection is guaranteed by other means. This applies to
uuid_mutex and device_list_mutex.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux