aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorJoanne Koong <[email protected]>2025-03-18 00:30:28 +0000
committerMiklos Szeredi <[email protected]>2025-03-31 12:59:27 +0000
commit1dfe2a220e9cd85861a853b00d8620222b960c1f (patch)
treef9bb92e91d7710034478dcbd33affb2f2588b4db /net/unix/af_unix.c
parentfuse: Increase FUSE_NAME_MAX to PATH_MAX (diff)
downloadkernel-1dfe2a220e9cd85861a853b00d8620222b960c1f.tar.gz
kernel-1dfe2a220e9cd85861a853b00d8620222b960c1f.zip
fuse: fix uring race condition for null dereference of fc
There is a race condition leading to a kernel crash from a null dereference when attemping to access fc->lock in fuse_uring_create_queue(). fc may be NULL in the case where another thread is creating the uring in fuse_uring_create() and has set fc->ring but has not yet set ring->fc when fuse_uring_create_queue() reads ring->fc. There is another race condition as well where in fuse_uring_register(), ring->nr_queues may still be 0 and not yet set to the new value when we compare qid against it. This fix sets fc->ring only after ring->fc and ring->nr_queues have been set, which guarantees now that ring->fc is a proper pointer when any queues are created and ring->nr_queues reflects the right number of queues if ring is not NULL. We must use smp_store_release() and smp_load_acquire() semantics to ensure the ordering will remain correct where fc->ring is assigned only after ring->fc and ring->nr_queues have been assigned. Signed-off-by: Joanne Koong <[email protected]> Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands") Reviewed-by: Bernd Schubert <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions