summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs42proc.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2022-03-08 13:42:17 +1100
committerTrond Myklebust <trond.myklebust@hammerspace.com>2022-03-23 14:50:04 -0400
commit3848e96edf4788f772d83990022fa7023a233d83 (patch)
treee3b204cdb8ae14a6b8864267edbbf6165a62bb6d /fs/nfs/nfs42proc.c
parenta245832aaa9930f0ea91527cbd70521722b89313 (diff)
downloadlinux-stable-3848e96edf4788f772d83990022fa7023a233d83.tar.gz
linux-stable-3848e96edf4788f772d83990022fa7023a233d83.tar.bz2
linux-stable-3848e96edf4788f772d83990022fa7023a233d83.zip
SUNRPC: avoid race between mod_timer() and del_timer_sync()
xprt_destory() claims XPRT_LOCKED and then calls del_timer_sync(). Both xprt_unlock_connect() and xprt_release() call ->release_xprt() which drops XPRT_LOCKED and *then* xprt_schedule_autodisconnect() which calls mod_timer(). This may result in mod_timer() being called *after* del_timer_sync(). When this happens, the timer may fire long after the xprt has been freed, and run_timer_softirq() will probably crash. The pairing of ->release_xprt() and xprt_schedule_autodisconnect() is always called under ->transport_lock. So if we take ->transport_lock to call del_timer_sync(), we can be sure that mod_timer() will run first (if it runs at all). Cc: stable@vger.kernel.org Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/nfs42proc.c')
0 files changed, 0 insertions, 0 deletions