Re: [PATCH] PCI/P2PDMA: Fix a sleeping issue in a RCU read section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 04, 2024 at 08:52:35PM +0100, Christophe JAILLET wrote:
> It is not allowed to sleep within a RCU read section, so use GFP_ATOMIC
> instead of GFP_KERNEL here.
> 
> Fixes: ae21f835a5bd ("PCI/P2PDMA: Finish RCU conversion of pdev->p2pdma")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> This patch is speculative.
> It is based on a discussion related to another patch. See [1].
> 
> It also matches the doc, IIUC. See [2]
> 
> [1]: https://lore.kernel.org/all/20240104143925.194295-3-alexis.lothore@xxxxxxxxxxx/
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/RCU/whatisRCU.rst#n161

Looks good to me.

Smatch is supposed to catch this sort of bug but there are some issues
with xa_store it's normally holding the the xas_lock() but if you pass
a sleeping GFP_ then it drops the lock in __xas_nomem().  Sort of
tricky.  So right now all xa_store() stuff triggers a false positive
but tomorrows version of Smatch will just miss this bug.

regards,
dan carpenter





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux