summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorZekun Shen <bruceshenzk@gmail.com>2020-06-15 11:50:29 -0400
committerSasha Levin <sashal@kernel.org>2020-06-30 23:17:14 -0400
commit8114ae273a366652eaf42eff4716e4f5a18c7988 (patch)
tree0fe6a366c2ea1ed8c761fdac0c6672de4000f9cb /arch/s390
parented1e2fcb187620947de899948439907f0df67faf (diff)
downloadlinux-stable-8114ae273a366652eaf42eff4716e4f5a18c7988.tar.gz
linux-stable-8114ae273a366652eaf42eff4716e4f5a18c7988.tar.bz2
linux-stable-8114ae273a366652eaf42eff4716e4f5a18c7988.zip
net: alx: fix race condition in alx_remove
[ Upstream commit e89df5c4322c1bf495f62d74745895b5fd2a4393 ] There is a race condition exist during termination. The path is alx_stop and then alx_remove. An alx_schedule_link_check could be called before alx_stop by interrupt handler and invoke alx_link_check later. Alx_stop frees the napis, and alx_remove cancels any pending works. If any of the work is scheduled before termination and invoked before alx_remove, a null-ptr-deref occurs because both expect alx->napis[i]. This patch fix the race condition by moving cancel_work_sync functions before alx_free_napis inside alx_stop. Because interrupt handler can call alx_schedule_link_check again, alx_free_irq is moved before cancel_work_sync calls too. Signed-off-by: Zekun Shen <bruceshenzk@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/s390')
0 files changed, 0 insertions, 0 deletions