Re: [PATCH net-next] net: kcm: Fix race condition in kcm_unattach()

From: Paolo Abeni
Date: Tue Aug 12 2025 - 08:59:38 EST


On 8/9/25 8:36 AM, Sven Stegemann wrote:
> @@ -1714,6 +1708,7 @@ static int kcm_release(struct socket *sock)
> /* Cancel work. After this point there should be no outside references
> * to the kcm socket.
> */
> + disable_work(&kcm->tx_work);
> cancel_work_sync(&kcm->tx_work);

The patch looks functionally correct, but I guess it would be cleaner
simply replacing:

cancel_work_sync(&kcm->tx_work);

with:

disable_work_sync(&kcm->tx_work);

Thanks,

Paolo