Linux virtualization list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lianjie Wang" <lian@is.s.u-tokyo.ac.jp>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH net v3 3/4] virtio_net: keep reads of stats records within the reply buffer
Date: Mon, 16 Nov 2026 09:42:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-216628@kernel.org> (raw)
In-Reply-To: <20261116092445.3391334-4-lian@is.s.u-tokyo.ac.jp>

> __virtnet_get_hw_stats() only checks that each record of the statistics
> reply starts within the reply buffer, while virtnet_fill_stats() reads
> the whole payload of the record's type, so a record near the end of the
> buffer can make the driver read past it and report the heap bytes
> through ethtool -S and the per-queue netlink statistics.
> 
> Fix this by reserving zeroed space of the largest ctx->size[] after the
> reply, so the buffer can hold any type of payload.
> 
> Records of an unexpected size are still parsed, since every record
> starts within the reply and cannot cause out-of-bounds reads, and
> rejecting them with checks per type was judged costly to maintain [1].
> 
> Claude Opus 5.5 was used to audit the driver and draft this patch. To
> reproduce, the virtio-net device in QEMU was modified to offer device
> [ ... ]
> Reported-by: Jakub Kicinski <kuba@kernel.org>
> Link: https://lore.kernel.org/all/20261110001659.1654289-2-kuba@kernel.org/
> Fixes: 941168f8b40e ("virtio_net: support device stats")
> Cc: stable@vger.kernel.org
> Signed-off-by: Lianjie Wang <lian@is.s.u-tokyo.ac.jp>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116092445.3391334-1-lian@is.s.u-tokyo.ac.jp?part=3


  reply	other threads:[~2026-11-16  9:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  9:24 [PATCH net v3 0/4] virtio_net: fix out-of-bounds accesses and a heap info leak via the device stats reply Lianjie Wang
2026-11-16  9:24 ` [PATCH net v3 1/4] virtio_net: reject stats replies for queues outside the request Lianjie Wang
2026-11-16  9:42   ` sashiko-bot
2026-11-16  9:24 ` [PATCH net v3 2/4] virtio_net: zero the stats reply buffer Lianjie Wang
2026-11-16  9:42   ` sashiko-bot
2026-11-16  9:24 ` [PATCH net v3 3/4] virtio_net: keep reads of stats records within the " Lianjie Wang
2026-11-16  9:42   ` sashiko-bot [this message]
2026-11-16  9:24 ` [PATCH net v3 4/4] virtio_net: report a failed stats command as an error Lianjie Wang
2026-11-16  9:42   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-216628@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=lian@is.s.u-tokyo.ac.jp \
    --cc=mst@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox