All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Николай Зорин" <zorin@swemel.ru>
Cc: Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, jasowang@redhat.com
Subject: Re: [PATCH] util/error, hw/net/virtio-net: fix NULL pointer dereference in error_vprepend
Date: Wed, 16 Sep 2026 11:21:28 -0400	[thread overview]
Message-ID: <20260916111206-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <410859ee-80a6-41f1-8b40-7e5014a6bd10@swemel.ru>

On Wed, Sep 16, 2026 at 04:48:19PM +0300, Николай Зорин wrote:
> Hello!
> 
> This is not AI-generated content. We have a dedicated team of engineers who
> monitor and analyze security events (ranging from ASan/TSan sanitizers to
> PVS-Studio) and perform statistical analysis (from cppcheck to SVACE and
> white bear). This is a strict requirement from our Quality Assurance
> department, which is mandatory for compliance with our government and
> commercial contracts. Unfortunately, I cannot share our internal security
> tools (especially since they are tailored to our environment and won't work
> for you). However, I can share what our engineers flag as potentially
> dangerous cases during their research. Since the patches we submit address
> long-standing vulnerabilities, we have to maintain them on our side for
> years, as they rarely get fixed in your upstream. If you think these
> findings are outdated or redundant, fine.

I don't know. The patches aren't documented to the level where I can
pass judgement. what there is, does not match code.

"We have an internal tool that flags this code as a bug, I'm not telling
you what it is and I have no idea if the patch is right, it makes my
tool shut up and my government happy, figure the rest out yourself" is
not how any of this works.

If you think your changes are important, work with your dedicated team
to figure out how to be prepared to defend them in public.

Good format to follow:

At the moment .... as a result ... but ... so ... and we can not ...
Fix this by ... as a result ...



> I'll try to convince our
> researchers to drop it—letting them know that the upstream developers
> consider this work completely unnecessary.

I merely consider it incomplete and poorly documented.

> P.S. We are backporting these from Debian 10 (even though the current
> release is Debian 13).

Shrug. This is not the tree against which qemu-devel patches are
supposed to be against.

> P.P.S. I used AI for correcting translate (I not good knowled english)
> 
> nice day
> 
> 16.09.2026 15:48, Markus Armbruster пишет:
> > First, please read docs/devel/code-provenance.rst section "Use of
> > AI-generated content".
> > 
> > I'm not looking at the patches, only the commit message.
> > 
> > Николай Зорин <zorin@swemel.ru> writes:
> > 
> > > SWSA#b0709cee-9722-4603-a30c-dc857dc87961
> > > 
> > > The `error_vprepend()` function modifies the error message inside an
> > > existing Error object. However, it only validated if the `errp` pointer
> > > itself was non-NULL, missing a check for whether the underlying Error
> > > object `*errp` is `NULL`.
> > This is nonsense.  error_vprepend() and error_prepend() modify an error.
> > They must not be called when there is none.  The check isn't missing.
> > Adding it makes the functions "work" papers over bugs.
> > 
> > > Calling `error_reportf_err(local_error, ...)` when `local_error` is `NULL`
> > > invokes `error_vprepend(&local_error, ...)`, which subsequently crashes
> > > via a `NULL` pointer dereference during `(*errp)->msg` access.
> > > 
> > > Fix `util/error.c` by adding a defensive `!*errp` check inside
> > > `error_vprepend()`.
> > > 
> > > Additionally, fix the invalid error reporting patterns in
> > > `hw/net/virtio-net.c`:
> > > - In `vhost_user_net_save_state()` and `vhost_user_net_load_state()`, when
> > >     `vhdev == NULL`, calling `error_reportf_err()` with an unallocated/NULL
> > >     `local_error` is incorrect and unsafe. Replace it with a straightforward
> > >     `error_report()` call.
> > Both uses of error_reportf_err() are indeed wrong.
> > 
> > > - Fix a cosmetic double-space typo in "Error loading  back-end state".
> > Worth cleaning up.
> > 
> > > Signed-off-by: Nikolay N Zorin <zorin@swemel.ru>



  reply	other threads:[~2026-09-16 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 16:24 [PATCH] util/error, hw/net/virtio-net: fix NULL pointer dereference in error_vprepend Николай Зорин
2026-09-15 16:47 ` Michael S. Tsirkin
2026-09-16 12:48 ` Markus Armbruster
2026-09-16 13:48   ` Николай Зорин
2026-09-16 15:21     ` Michael S. Tsirkin [this message]
2026-09-17  9:55     ` Markus Armbruster

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=20260916111206-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zorin@swemel.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.