aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-internal.h
diff options
context:
space:
mode:
authorMadhuparna Bhowmik <[email protected]>2020-06-04 16:51:21 -0700
committerLinus Torvalds <[email protected]>2020-06-04 19:06:26 -0700
commite1c3cdb26ab881b77486dc50370356a349077c74 (patch)
treedc5ef6ebebbdc59ab3c4ecedbe8d574a72abb0c1 /lib/mpi/mpi-internal.h
parent762a3af6faa0682e5b30b67b1db156c7df55f2c7 (diff)
rapidio: avoid data race between file operation callbacks and mport_cdev_add().
Fields of md(mport_dev) are set after cdev_device_add(). However, the file operation callbacks can be called after cdev_device_add() and therefore accesses to fields of md in the callbacks can race with the rest of the mport_cdev_add() function. One such example is INIT_LIST_HEAD(&md->portwrites) in mport_cdev_add(), the list is initialised after cdev_device_add(). This can race with list_add_tail(&pw_filter->md_node,&md->portwrites) in rio_mport_add_pw_filter() which is called by unlocked_ioctl. To avoid such data races use cdev_device_add() after initializing md. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Madhuparna Bhowmik <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Alexandre Bounine <[email protected]> Cc: Matt Porter <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Mike Marshall <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ira Weiny <[email protected]> Cc: Allison Randal <[email protected]> Cc: Pavel Andrianov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-internal.h')
0 files changed, 0 insertions, 0 deletions