[PATCH v3] vhost/net: Protect ubufs with rcu read lock in vhost_net_ubuf_put()

2025-08-05 Thread Nikolay Kuratov
checking deadlock") Reported-by: Andrey Ryabinin Suggested-by: Hillf Danton Signed-off-by: Nikolay Kuratov --- v2: * move reinit_completion() into vhost_net_flush(), thanks to Hillf Danton * add Tested-by: Lei Yang * check that usages of put_and_wait() are consistent across LTS kernels v3: *

Re: [PATCH] vhost/net: Replace wait_queue with completion in ubufs reference

2025-07-18 Thread Nikolay Kuratov
> reinit after wait, so the chance for missing wakeup still exists. Can you please provide more details on this? Yes, it is reinit after wait, but wait should not be concurrent. I checked multiple code pathes towards vhost_net_flush(), they're all protected by device mutex, except vhost_net_releas

[PATCH v2] vhost/net: Replace wait_queue with completion in ubufs reference

2025-07-18 Thread Nikolay Kuratov
e refcnt == 0 does not mean freeing in that case. Cc: sta...@vger.kernel.org Fixes: 0ad8b480d6ee9 ("vhost: fix ref cnt checking deadlock") Reported-by: Andrey Ryabinin Suggested-by: Andrey Smetanin Suggested-by: Hillf Danton Tested-by: Lei Yang (v1) Signed-off-by: Nikolay

Re: [PATCH] vhost/net: Replace wait_queue with completion in ubufs reference

2025-07-18 Thread Nikolay Kuratov
Yes, if multiple waiters call vhost_net_ubuf_put_and_wait() concurrently we are screwed. Furthermore, it was not the case before this patch. While it was explicitly mentioned in the commit message, now I changed my mind, because amount of vhost_net_ubuf_put_and_wait() users may change when this pat

[PATCH] vhost/net: Replace wait_queue with completion in ubufs reference

2025-07-16 Thread Nikolay Kuratov
ompletion() right after wait_for_completion() should be fine. Cc: sta...@vger.kernel.org Fixes: 0ad8b480d6ee9 ("vhost: fix ref cnt checking deadlock") Reported-by: Andrey Ryabinin Suggested-by: Andrey Smetanin Signed-off-by: Nikolay Kuratov --- drivers/vhost/net.c | 9 + 1 file

[PATCH] tracing/kprobes: Add missing check for skipping symbol counting logic

2024-07-04 Thread Nikolay Kuratov
ons passed over perf_event_open(). Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols") Signed-off-by: Nikolay Kuratov --- kernel/trace/trace_kprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_kpr

[PATCH v2] vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

2023-12-11 Thread Nikolay Kuratov
We need to do signed arithmetic if we expect condition `if (bytes < 0)` to be possible Found by Linux Verification Center (linuxtesting.org) with SVACE Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko") Signed-off-by: Nikolay Kuratov --- V1 -> V2: Added Fix

[PATCH] vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

2023-12-11 Thread Nikolay Kuratov
We need to do signed arithmetic if we expect condition `if (bytes < 0)` to be possible Found by Linux Verification Center (linuxtesting.org) with SVACE Signed-off-by: Nikolay Kuratov --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi