2022-02-24 01:28:54

by Karsten Graul

[permalink] [raw]
Subject: Re: [PATCH] net/smc: Use a mutex for locking "struct smc_pnettable"

On 23/02/2022 11:02, Fabio M. De Francesco wrote:
> 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: [email protected]
> Fixes: 64e28b52c7a6 ("net/smc: add pnet table namespace support")
> Confirmed-by: Tony Lu <[email protected]>
> Signed-off-by: Fabio M. De Francesco <[email protected]>
> ---

Thank you Fabio!

This should go to the net tree...

Acked-by: Karsten Graul <[email protected]>