* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-04 13:15 [GIT PULL] vhost,virtio,vdpa: bugfixes Michael S. Tsirkin
@ 2026-11-04 13:26 ` Paul Moses
2026-11-06 0:57 ` pr-tracker-bot
2026-11-24 13:51 ` Lorenzo Stoakes (ARM)
2 siblings, 0 replies; 10+ messages in thread
From: Paul Moses @ 2026-11-04 13:26 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Linus Torvalds, kvm, virtualization, netdev, linux-kernel,
2312891301, blum, co+6dcbccedc9ec6452, eperezma, fangxy,
jasowangio, kmehltretter, linfeng.sun.dev, lirongqing, longpareto,
oss.patchbox, phx0fer, physicalmtea, sergiiushakov, shubham,
stable, stjepan.poljak, syzbot+13df72e0dc4be5c62215, tavhadia,
tjdqudcks0424, tz2294, xieyongji, xmei5, yuz08559, zenghui.yu,
zhaimingbing, zhangjiao2
On Thu, Mar 12, 2026 at 06:56:40AM +0000, Paul Moses wrote:
> > On Wed, Mar 11, 2026 at 08:00:45PM -0400, Michael S. Tsirkin wrote:
> > > On Wed, Mar 11, 2026 at 02:12:17PM +0000, Paul Moses wrote:
> > > > >
> > > > > Indeed, seems legit, thanks!
> > > > >
> > > > > The only thing is that I dislike two error handling paths here.
> > > > > So I wonder why isn't this as simple as fixing the double free
> > > > > directly:
> > > > >
> > > >
> > > > That works for me, should I send it out?
> > > >
> > > > Thanks,
> > > > Paul
> > >
> > >
> > > Please do.
> > >
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >
> > Oh and I forgot
> >
> > Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
> >
> >
> > >
> > > --
> > > MST
> >
> >
>
> Considering that this pattern has occurred in multiple independent source files,
> maybe it is worth it to make intent more clear? What about this?
>
> >From c3b9431dc736cec60c0b288b13d9fa718341f46a Mon Sep 17 00:00:00 2001
> From: Paul Moses <p@1g4.org>
> Date: Tue, 10 Mar 2026 15:23:58 -0500
> Subject: [PATCH] vdpa: don't free reply skb after genlmsg_reply()
>
> genlmsg_reply() hands the reply skb to netlink, and
> netlink_unicast() consumes it on all return paths, whether the
> skb is queued successfully or freed on an error path.
>
> vdpa_nl_cmd_dev_config_get_doit() currently jumps to nlmsg_free(msg)
> after genlmsg_reply() fails, which can hit the same skb twice.
>
> Return the genlmsg_reply() error directly and keep nlmsg_free()
> only for pre-reply failures.
>
> Fixes: ad69dd0bf26b ("vdpa: Introduce query of device config layout")
> Cc: stable@vger.kernel.org
>
> Signed-off-by: Paul Moses <p@1g4.org>
I like crediting people for their work. Let's do this. Pls post as a
proper patch starting a new thread, so all 0day tooling catches this,
and I'll apply. I'll then apply a rework removing the duplication, on
top. Thanks!
> ---
> drivers/vdpa/vdpa.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
> index 34874beb0152e..702d3a7772219 100644
> --- a/drivers/vdpa/vdpa.c
> +++ b/drivers/vdpa/vdpa.c
> @@ -1352,15 +1352,19 @@ static int vdpa_nl_cmd_dev_config_get_doit(struct sk_buff *skb, struct genl_info
> }
> err = vdpa_dev_config_fill(vdev, msg, info->snd_portid, info->snd_seq,
> 0, info->extack);
> - if (!err)
> - err = genlmsg_reply(msg, info);
> + if (err)
> + goto mdev_err;
> +
> + put_device(dev);
> + up_read(&vdpa_dev_lock);
> +
> + return genlmsg_reply(msg, info);
>
> mdev_err:
> put_device(dev);
> dev_err:
> up_read(&vdpa_dev_lock);
> - if (err)
> - nlmsg_free(msg);
> + nlmsg_free(msg);
> return err;
> }
>
> --
> 2.53.GIT
>
It's obvious now your intention was always to diminish my
contribution. This really only reflects negatively on you.
You or claude didn't even disassemble it. It's slop. My
patch is objectively superior both in human readability
and performance.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-04 13:15 [GIT PULL] vhost,virtio,vdpa: bugfixes Michael S. Tsirkin
2026-11-04 13:26 ` Paul Moses
@ 2026-11-06 0:57 ` pr-tracker-bot
2026-11-24 13:51 ` Lorenzo Stoakes (ARM)
2 siblings, 0 replies; 10+ messages in thread
From: pr-tracker-bot @ 2026-11-06 0:57 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Linus Torvalds, kvm, virtualization, netdev, linux-kernel,
2312891301, blum, co+6dcbccedc9ec6452, eperezma, fangxy,
jasowangio, kmehltretter, linfeng.sun.dev, lirongqing, longpareto,
mst, oss.patchbox, p, phx0fer, physicalmtea, sergiiushakov,
shubham, stable, stjepan.poljak, syzbot+13df72e0dc4be5c62215,
tavhadia, tjdqudcks0424, tz2294, xieyongji, xmei5, yuz08559,
zenghui.yu, zhaimingbing, zhangjiao2
The pull request you sent on Wed, 4 Nov 2026 08:15:35 -0500:
> https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/69e2b55fc3b4fa3639b8c320374c255f046ddda5
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-04 13:15 [GIT PULL] vhost,virtio,vdpa: bugfixes Michael S. Tsirkin
2026-11-04 13:26 ` Paul Moses
2026-11-06 0:57 ` pr-tracker-bot
@ 2026-11-24 13:51 ` Lorenzo Stoakes (ARM)
2026-11-25 6:05 ` chenglong.ma
2 siblings, 1 reply; 10+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-11-24 13:51 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Linus Torvalds, kvm, virtualization, netdev, linux-kernel,
2312891301, blum, co+6dcbccedc9ec6452, eperezma, fangxy,
jasowangio, kmehltretter, linfeng.sun.dev, lirongqing, longpareto,
oss.patchbox, p, phx0fer, physicalmtea, sergiiushakov, shubham,
stable, stjepan.poljak, syzbot+13df72e0dc4be5c62215, tavhadia,
tjdqudcks0424, tz2294, xieyongji, xmei5, yuz08559, zenghui.yu,
zhaimingbing, zhangjiao2
On Wed, Nov 04, 2026 at 08:15:35AM -0500, Michael S. Tsirkin wrote:
> chenglong.ma (1):
> vduse: fix VA/PA confusion in the coherent page fault path
This has landed as commit bb2e6f166547 ("vduse: fix VA/PA confusion in the
coherent page fault path") but I don't see the patch anywhere on lore (off-list
security report?)
Anyway, clearly nobody actually _ran_ this code in 7.4, not even claude, as
it's completely broken.
Commit 99fd6bf43d5d ("mm/vma: enforce that mm-managed mappings may not set
VMA_IO_BIT") literally made setting VM_IO incorrectly, like this patch does, a
WARN_ON error on mmap(), i.e. it _refuses_ to mmap it :)
It looks like it doesn't need VM_IO anyway, the other changes in the patch
make it redundant AFAICT, so you should send something like the below with
a Fixes pointing at bb2e6f166547:
--- a/drivers/vdpa/vdpa_user/iova_domain.c
+++ b/drivers/vdpa/vdpa_user/iova_domain.c
@@ static int vduse_domain_mmap(struct file *file, struct vm_area_struct *vma)
- vm_flags_set(vma, VM_IO | VM_DONTDUMP | VM_DONTEXPAND);
+ vm_flags_set(vma, VM_DONTDUMP | VM_DONTEXPAND);
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-24 13:51 ` Lorenzo Stoakes (ARM)
@ 2026-11-25 6:05 ` chenglong.ma
2026-11-25 12:25 ` Lorenzo Stoakes (ARM)
0 siblings, 1 reply; 10+ messages in thread
From: chenglong.ma @ 2026-11-25 6:05 UTC (permalink / raw)
To: Lorenzo Stoakes, Michael S . Tsirkin
Cc: Linus Torvalds, kvm, virtualization, netdev, linux-kernel,
2312891301, blum, co+6dcbccedc9ec6452, eperezma, fangxy,
jasowangio, kmehltretter, linfeng.sun.dev, lirongqing,
oss.patchbox, p, phx0fer, physicalmtea, sergiiushakov, shubham,
stable, stjepan.poljak, syzbot+13df72e0dc4be5c62215, tavhadia,
tjdqudcks0424, tz2294, xieyongji, xmei5, yuz08559, zenghui.yu,
zhaimingbing, zhangjiao2
On Tue, Nov 24, 2026 at 01:51:29PM +0000, Lorenzo Stoakes (ARM) wrote:
> It looks like it doesn't need VM_IO anyway, the other changes in the patch
> make it redundant AFAICT, so you should send something like the below with
> a Fixes pointing at bb2e6f166547:
Sorry about that: it went to security@kernel.org (hence no lore thread),
I did not test it on 7.4-rc, and you're right that VM_IO is redundant,
since vduse_domain_set_map() is the only way vhost-vdpa entries reach
the domain iotlb and it already rejects anything backed by the domain
file.
I'll send the one-liner with Fixes: bb2e6f166547 and your Reported-by
and Suggested-by once I have actually run it on current mainline.
Thanks for catching this.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-25 6:05 ` chenglong.ma
@ 2026-11-25 12:25 ` Lorenzo Stoakes (ARM)
2026-11-25 21:21 ` Paul Moses
0 siblings, 1 reply; 10+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-11-25 12:25 UTC (permalink / raw)
To: chenglong.ma
Cc: Michael S . Tsirkin, Linus Torvalds, kvm, virtualization, netdev,
linux-kernel, 2312891301, blum, co+6dcbccedc9ec6452, eperezma,
fangxy, jasowangio, kmehltretter, linfeng.sun.dev, lirongqing,
oss.patchbox, p, phx0fer, physicalmtea, sergiiushakov, shubham,
stable, stjepan.poljak, syzbot+13df72e0dc4be5c62215, tavhadia,
tjdqudcks0424, tz2294, xieyongji, xmei5, yuz08559, zenghui.yu,
zhaimingbing, zhangjiao2
On Wed, Nov 25, 2026 at 02:05:32PM +0800, chenglong.ma wrote:
> On Tue, Nov 24, 2026 at 01:51:29PM +0000, Lorenzo Stoakes (ARM) wrote:
> > It looks like it doesn't need VM_IO anyway, the other changes in the patch
> > make it redundant AFAICT, so you should send something like the below with
> > a Fixes pointing at bb2e6f166547:
>
> Sorry about that: it went to security@kernel.org (hence no lore thread),
> I did not test it on 7.4-rc, and you're right that VM_IO is redundant,
> since vduse_domain_set_map() is the only way vhost-vdpa entries reach
> the domain iotlb and it already rejects anything backed by the domain
> file.
Please, in future, when you submit something for a kernel release, test your
change against that kernel release :) or get your LLM to ;)
>
> I'll send the one-liner with Fixes: bb2e6f166547 and your Reported-by
> and Suggested-by once I have actually run it on current mainline.
Thanks!
>
> Thanks for catching this.
--
Cheers, Lorenzo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-25 12:25 ` Lorenzo Stoakes (ARM)
@ 2026-11-25 21:21 ` Paul Moses
2026-11-25 21:46 ` Michael S. Tsirkin
0 siblings, 1 reply; 10+ messages in thread
From: Paul Moses @ 2026-11-25 21:21 UTC (permalink / raw)
To: Lorenzo Stoakes (ARM)
Cc: chenglong.ma, Michael S . Tsirkin, Linus Torvalds, kvm,
virtualization, netdev, linux-kernel, 2312891301, blum,
co+6dcbccedc9ec6452, eperezma, fangxy, jasowangio, kmehltretter,
linfeng.sun.dev, lirongqing, oss.patchbox, phx0fer, physicalmtea,
sergiiushakov, shubham, stable, stjepan.poljak,
syzbot+13df72e0dc4be5c62215, tavhadia, tjdqudcks0424, tz2294,
xieyongji, xmei5, yuz08559, zenghui.yu, zhaimingbing, zhangjiao2
There appears to be a recurring problem with how previously reported
vulnerabilities are being handled in this subsystem.
Yu Zhang publicly reported the VDUSE VA/PA confusion on August 7,
including runtime evidence and a proposed fix:
https://lore.kernel.org/r/20260807022657.11318-1-yuz08559@gmail.com
Nearly three months later, bb2e6f166547 was merged with attribution to
Claude Code, but without any acknowledgment of Yu's earlier report. As
Lorenzo has now pointed out, the accepted patch also breaks the driver's
mmap path.
This is particularly concerning given my own experience with the vDPA
netlink double-free.
I reported the issue in March, submitted a patch at your request, provided
runtime evidence, and received repeated assurances that my patch would be
applied. Nearly eight months later, a different Claude-assisted implementation
was merged instead after I reported it to security list a second time.
I acknowledge that I eventually received a Reported-by tag. That does not explain
why a known and acknowledged memory-safety defect remained unfixed for nearly eight
months.
I have no objection to the use of AI-assisted development. I do object to a process
in which previously submitted security fixes remain unresolved for months, only to
be replaced by AI-assisted implementations, particularly when those implementations
introduce regressions that basic functional testing would have caught.
Why was Yu Zhang's earlier report not acknowledged?
And what is being done to ensure that previously reported vulnerabilities are not left
unresolved until they are rediscovered?
Thanks,
Paul
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [GIT PULL] vhost,virtio,vdpa: bugfixes
2026-11-25 21:21 ` Paul Moses
@ 2026-11-25 21:46 ` Michael S. Tsirkin
0 siblings, 0 replies; 10+ messages in thread
From: Michael S. Tsirkin @ 2026-11-25 21:46 UTC (permalink / raw)
To: Paul Moses
Cc: Lorenzo Stoakes (ARM), chenglong.ma, Linus Torvalds, kvm,
virtualization, netdev, linux-kernel, 2312891301, blum,
co+6dcbccedc9ec6452, eperezma, fangxy, jasowangio, kmehltretter,
linfeng.sun.dev, lirongqing, oss.patchbox, phx0fer, physicalmtea,
sergiiushakov, shubham, stable, stjepan.poljak,
syzbot+13df72e0dc4be5c62215, tavhadia, tjdqudcks0424, tz2294,
xieyongji, xmei5, yuz08559, zenghui.yu, zhaimingbing, zhangjiao2
First, thanks for your quality bug reports. I saw a fair share of these!
To answer your questions:
On Wed, Nov 25, 2026 at 09:21:01PM +0000, Paul Moses wrote:
> There appears to be a recurring problem with how previously reported
> vulnerabilities are being handled in this subsystem.
>
> Yu Zhang publicly reported the VDUSE VA/PA confusion on August 7,
> including runtime evidence and a proposed fix:
>
> https://lore.kernel.org/r/20260807022657.11318-1-yuz08559@gmail.com
>
> Nearly three months later, bb2e6f166547 was merged with attribution to
> Claude Code, but without any acknowledgment of Yu's earlier report.
Mostly what happened is that Jason left RH, and at the same time a wave
of vuln reports hit, and this one got some "critical" sashiko reviews.
Which I didn't look closely at, but at the same time, the reporter
really could have responded to, but instead ignored. The patch was not
Cc stable, even. I could have looked at the patch more closely and
noticed there's a reported security problem and tracked it.
> As
> Lorenzo has now pointed out, the accepted patch also breaks the driver's
> mmap path.
yea, not good.
> This is particularly concerning given my own experience with the vDPA
> netlink double-free.
>
> I reported the issue in March, submitted a patch at your request, provided
> runtime evidence, and received repeated assurances that my patch would be
> applied. Nearly eight months later, a different Claude-assisted implementation
> was merged instead after I reported it to security list a second time.
>
> I acknowledge that I eventually received a Reported-by tag. That does not explain
> why a known and acknowledged memory-safety defect remained unfixed for nearly eight
> months.
I don't at this time remember why it took a lot of time or why I chose that patch at
this point, sorry.
> I have no objection to the use of AI-assisted development. I do object to a process
> in which previously submitted security fixes remain unresolved for months, only to
> be replaced by AI-assisted implementations, particularly when those implementations
> introduce regressions that basic functional testing would have caught.
>
> Why was Yu Zhang's earlier report not acknowledged?
Because the reporter didn't follow the process.
> And what is being done to ensure that previously reported vulnerabilities are not left
> unresolved until they are rediscovered?
>
> Thanks,
> Paul
Following the process helps. You did good by pinging repeatedly and the
problem was fixed as opposed to rediscovered. Thanks a lot for that.
I'm not as quick as I'd like to be. Make mistakes, too (
If more people can pitch in and help review patches, that will help a lot!
--
MST
^ permalink raw reply [flat|nested] 10+ messages in thread