Skip to content
Commit 7ff57e98 authored by Fabio M. De Francesco's avatar Fabio M. De Francesco Committed by Jakub Kicinski
Browse files

net/smc: Use a mutex for locking "struct smc_pnettable"



smc_pnetid_by_table_ib() uses read_lock() and then it calls smc_pnet_apply_ib()
which, in turn, calls mutex_lock(&smc_ib_devices.mutex).

read_lock() disables preemption. Therefore, the code acquires a mutex while in
atomic context and it leads to a SAC bug.

Fix this bug by replacing the rwlock with a mutex.

Reported-and-tested-by: default avatar <syzbot+4f322a6d84e991c38775@syzkaller.appspotmail.com>
Fixes: 64e28b52

 ("net/smc: add pnet table namespace support")
Confirmed-by: default avatarTony Lu <tonylu@linux.alibaba.com>
Signed-off-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20220223100252.22562-1-fmdefrancesco@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e13ad144
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment