Re: [PATCH] vsock/virtio: use GFP_ATOMIC under RCU read lock
From: Christian Brauner
Date: Thu Oct 03 2024 - 05:09:33 EST
On Wed, Oct 02, 2024 at 09:41:42AM GMT, Michael S. Tsirkin wrote:
> virtio_transport_send_pkt in now called on transport fast path,
> under RCU read lock. In that case, we have a bug: virtio_add_sgs
> is called with GFP_KERNEL, and might sleep.
>
> Pass the gfp flags as an argument, and use GFP_ATOMIC on
> the fast path.
>
> Link: https://lore.kernel.org/all/hfcr2aget2zojmqpr4uhlzvnep4vgskblx5b6xf2ddosbsrke7@nt34bxgp7j2x
> Fixes: efcd71af38be ("vsock/virtio: avoid queuing packets when intermediate queue is empty")
> Reported-by: Christian Brauner <brauner@xxxxxxxxxx>
> Cc: Stefano Garzarella <sgarzare@xxxxxxxxxx>
> Cc: Luigi Leonardi <luigi.leonardi@xxxxxxxxxxx>
> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> ---
>
> Lightly tested. Christian, could you pls confirm this fixes the problem
> for you? Stefano, it's a holiday here - could you pls help test!
> Thanks!
Thank you for the quick fix:
Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>