aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/fpga-bridge.c
diff options
context:
space:
mode:
authorLi Nan <[email protected]>2023-11-16 16:23:16 +0000
committerJens Axboe <[email protected]>2023-11-20 17:16:44 +0000
commitc2da049f419417808466c529999170f5c3ef7d3d (patch)
tree995e8ca613b5d08357091eeb6770ed9db542a6b9 /drivers/fpga/fpga-bridge.c
parentnbd: factor out a helper to get nbd_config without holding 'config_lock' (diff)
downloadkernel-c2da049f419417808466c529999170f5c3ef7d3d.tar.gz
kernel-c2da049f419417808466c529999170f5c3ef7d3d.zip
nbd: fix null-ptr-dereference while accessing 'nbd->config'
Memory reordering may occur in nbd_genl_connect(), causing config_refs to be set to 1 while nbd->config is still empty. Opening nbd at this time will cause null-ptr-dereference. T1 T2 nbd_open nbd_get_config_unlocked nbd_genl_connect nbd_alloc_and_init_config //memory reordered refcount_set(&nbd->config_refs, 1) // 2 nbd->config ->null point nbd->config = config // 1 Fix it by adding smp barrier to guarantee the execution sequence. Signed-off-by: Li Nan <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions