aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/fpga-region.c
diff options
context:
space:
mode:
authorEric W. Biederman <[email protected]>2017-03-05 21:03:22 +0000
committerEric W. Biederman <[email protected]>2017-03-06 21:26:37 +0000
commit040757f738e13caaa9c5078bca79aa97e11dde88 (patch)
treed2254d13ea030261eb3d894f8d7c3401f3e8a5e3 /drivers/fpga/fpga-region.c
parentLinux 4.11-rc1 (diff)
downloadkernel-040757f738e13caaa9c5078bca79aa97e11dde88.tar.gz
kernel-040757f738e13caaa9c5078bca79aa97e11dde88.zip
ucount: Remove the atomicity from ucount->count
Always increment/decrement ucount->count under the ucounts_lock. The increments are there already and moving the decrements there means the locking logic of the code is simpler. This simplification in the locking logic fixes a race between put_ucounts and get_ucounts that could result in a use-after-free because the count could go zero then be found by get_ucounts and then be freed by put_ucounts. A bug presumably this one was found by a combination of syzkaller and KASAN. JongWhan Kim reported the syzkaller failure and Dmitry Vyukov spotted the race in the code. Cc: [email protected] Fixes: f6b2db1a3e8d ("userns: Make the count of user namespaces per user") Reported-by: JongHwan Kim <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Reviewed-by: Andrei Vagin <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-region.c')
0 files changed, 0 insertions, 0 deletions