public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Alexander Bulekov <alxndr@bu.edu>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [PULL 28/41] hw/char/virtio-serial: Do not expose the 'emergency-write' property
Date: Mon, 16 Feb 2026 11:21:28 -0600	[thread overview]
Message-ID: <CAHUE=o-TKQa-ttPBGt++kkT7CHyjyMR7-j7rJtr3YzB=-iHXvA@mail.gmail.com> (raw)
In-Reply-To: <20260212144244.22579-29-pbonzini@redhat.com>

On 260212 1542, Paolo Bonzini wrote:
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> The VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set
> in the hw_compat_2_7[] array, via the 'emergency-write=off'
> property. We removed all machines using that array, lets remove
> that property. All instances have this feature bit set and
> it can not be disabled. VirtIOSerial::host_features mask is
> now unused, remove it.
>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> Link: https://lore.kernel.org/r/20260108033051.777361-28-zhao1.liu@intel.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Hello,
This change appears to have introduced a Heap-buffer-overflow:
https://gitlab.com/qemu-project/qemu/-/issues/3303
-Alex

> ---
>  include/hw/virtio/virtio-serial.h | 2 --
>  hw/char/virtio-serial-bus.c       | 9 +++------
>  2 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h
> index 60641860bf8..da0c91e1a40 100644
> --- a/include/hw/virtio/virtio-serial.h
> +++ b/include/hw/virtio/virtio-serial.h
> @@ -186,8 +186,6 @@ struct VirtIOSerial {
>      struct VirtIOSerialPostLoad *post_load;
>
>      virtio_serial_conf serial;
> -
> -    uint64_t host_features;
>  };
>
>  /* Interface to the virtio-serial bus */
> diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
> index 5ec5f5313b2..b7c57ea9678 100644
> --- a/hw/char/virtio-serial-bus.c
> +++ b/hw/char/virtio-serial-bus.c
> @@ -557,7 +557,7 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t features,
>
>      vser = VIRTIO_SERIAL(vdev);
>
> -    features |= vser->host_features;
> +    features |= BIT_ULL(VIRTIO_CONSOLE_F_EMERG_WRITE);
>      if (vser->bus.max_nr_ports > 1) {
>          virtio_add_feature(&features, VIRTIO_CONSOLE_F_MULTIPORT);
>      }
> @@ -587,8 +587,7 @@ static void set_config(VirtIODevice *vdev, const uint8_t *config_data)
>      VirtIOSerialPortClass *vsc;
>      uint8_t emerg_wr_lo;
>
> -    if (!virtio_has_feature(vser->host_features,
> -        VIRTIO_CONSOLE_F_EMERG_WRITE) || !config->emerg_wr) {
> +    if (!config->emerg_wr) {
>          return;
>      }
>
> @@ -1040,7 +1039,7 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp)
>          return;
>      }
>
> -    if (!virtio_has_feature(vser->host_features,
> +    if (!virtio_has_feature(vdev->host_features,
>                              VIRTIO_CONSOLE_F_EMERG_WRITE)) {
>          config_size = offsetof(struct virtio_console_config, emerg_wr);
>      }
> @@ -1156,8 +1155,6 @@ static const VMStateDescription vmstate_virtio_console = {
>  static const Property virtio_serial_properties[] = {
>      DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_ports,
>                                                    31),
> -    DEFINE_PROP_BIT64("emergency-write", VirtIOSerial, host_features,
> -                      VIRTIO_CONSOLE_F_EMERG_WRITE, true),
>  };
>
>  static void virtio_serial_class_init(ObjectClass *klass, const void *data)
> --
> 2.52.0
>
>


  reply	other threads:[~2026-02-16 17:22 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 14:42 [PULL 00/41] QOM, target/i386 patches for 2026-02-12 Paolo Bonzini
2026-02-12 14:42 ` [PULL 01/41] target/i386: convert SEV-ES termination requests to guest panic events Paolo Bonzini
2026-02-12 14:42 ` [PULL 02/41] hw/i386/pc: Remove deprecated pc-q35-2.6 and pc-i440fx-2.6 machines Paolo Bonzini
2026-02-12 14:42 ` [PULL 03/41] tests/acpi: Allow DSDT table change for x86 machines Paolo Bonzini
2026-02-12 14:42 ` [PULL 04/41] pc: Start with modern CPU hotplug interface by default Paolo Bonzini
2026-03-16 16:01   ` Peter Maydell
2026-03-17  4:23     ` Zhao Liu
2026-03-17 14:21       ` Peter Maydell
2026-02-12 14:42 ` [PULL 05/41] hw/i386/pc: Remove PCMachineClass::legacy_cpu_hotplug field Paolo Bonzini
2026-02-12 14:42 ` [PULL 06/41] acpi: Remove legacy cpu hotplug utilities Paolo Bonzini
2026-02-12 14:42 ` [PULL 07/41] docs/specs/acpi_cpu_hotplug: Remove legacy cpu hotplug descriptions Paolo Bonzini
2026-02-12 14:42 ` [PULL 08/41] tests/acpi: Update DSDT tables for pc & q35 machines Paolo Bonzini
2026-02-12 14:42 ` [PULL 09/41] hw/nvram/fw_cfg: Rename fw_cfg_init_mem() with '_nodma' suffix Paolo Bonzini
2026-02-12 14:42 ` [PULL 10/41] hw/mips/loongson3_virt: Prefer using fw_cfg_init_mem_nodma() Paolo Bonzini
2026-02-12 14:42 ` [PULL 11/41] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Paolo Bonzini
2026-02-12 14:42 ` [PULL 12/41] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Paolo Bonzini
2026-02-12 14:42 ` [PULL 13/41] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Paolo Bonzini
2026-02-12 14:42 ` [PULL 14/41] hw/i386/pc: Remove multiboot.bin Paolo Bonzini
2026-02-12 14:42 ` [PULL 15/41] hw/i386: Assume fw_cfg DMA is always enabled Paolo Bonzini
2026-02-12 14:42 ` [PULL 16/41] hw/i386: Remove linuxboot.bin Paolo Bonzini
2026-03-24 12:12   ` Daniel P. Berrangé
2026-03-24 12:14     ` Paolo Bonzini
2026-02-12 14:42 ` [PULL 17/41] hw/i386/pc: Remove pc_compat_2_6[] array Paolo Bonzini
2026-02-12 14:42 ` [PULL 18/41] hw/intc/apic: Remove APICCommonState::legacy_instance_id field Paolo Bonzini
2026-02-12 14:42 ` [PULL 19/41] hw/core/machine: Remove hw_compat_2_6[] array Paolo Bonzini
2026-02-12 14:42 ` [PULL 20/41] hw/virtio/virtio-mmio: Remove VirtIOMMIOProxy::format_transport_address field Paolo Bonzini
2026-02-12 14:42 ` [PULL 21/41] hw/i386/pc: Remove deprecated pc-q35-2.7 and pc-i440fx-2.7 machines Paolo Bonzini
2026-02-12 14:42 ` [PULL 22/41] hw/i386/pc: Remove pc_compat_2_7[] array Paolo Bonzini
2026-02-12 14:42 ` [PULL 23/41] target/i386/cpu: Remove CPUX86State::full_cpuid_auto_level field Paolo Bonzini
2026-02-12 14:42 ` [PULL 24/41] hw/audio/pcspk: Remove PCSpkState::migrate field Paolo Bonzini
2026-02-12 14:42 ` [PULL 25/41] hw/core/machine: Remove hw_compat_2_7[] array Paolo Bonzini
2026-02-12 14:42 ` [PULL 26/41] hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field Paolo Bonzini
2026-02-12 14:42 ` [PULL 27/41] hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field Paolo Bonzini
2026-02-12 14:42 ` [PULL 28/41] hw/char/virtio-serial: Do not expose the 'emergency-write' property Paolo Bonzini
2026-02-16 17:21   ` Alexander Bulekov [this message]
2026-02-12 14:42 ` [PULL 29/41] i386/cpu: Fix incorrect initializer in Diamond Rapids definition Paolo Bonzini
2026-02-12 14:42 ` [PULL 30/41] target/i386/kvm: set KVM_PMU_CAP_DISABLE if "-pmu" is configured Paolo Bonzini
2026-02-12 14:42 ` [PULL 31/41] target/i386/kvm: extract unrelated code out of kvm_x86_build_cpuid() Paolo Bonzini
2026-02-12 14:42 ` [PULL 32/41] target/i386/kvm: rename architectural PMU variables Paolo Bonzini
2026-02-12 14:42 ` [PULL 33/41] target/i386/kvm: reset AMD PMU registers during VM reset Paolo Bonzini
2026-02-12 14:42 ` [PULL 34/41] target/i386/kvm: support perfmon-v2 for reset Paolo Bonzini
2026-02-12 14:42 ` [PULL 35/41] qdev: Free property array on release Paolo Bonzini
2026-02-12 14:42 ` [PULL 36/41] qdev: make release_string() idempotent Paolo Bonzini
2026-02-12 14:42 ` [PULL 37/41] qdev: make release_drive() idempotent Paolo Bonzini
2026-02-12 14:42 ` [PULL 38/41] qdev: make release_tpm() idempotent Paolo Bonzini
2026-02-12 14:42 ` [PULL 39/41] tests: add /qdev/free-properties test Paolo Bonzini
2026-02-12 14:42 ` [PULL 40/41] accel/mshv: Remove remap overlapping mappings code Paolo Bonzini
2026-02-12 14:42 ` [PULL 41/41] target/i386/mshv: remove unused optimization of gva=>gpa translation Paolo Bonzini
2026-02-12 16:26 ` [PULL 00/41] QOM, target/i386 patches for 2026-02-12 Peter Maydell

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='CAHUE=o-TKQa-ttPBGt++kkT7CHyjyMR7-j7rJtr3YzB=-iHXvA@mail.gmail.com' \
    --to=alxndr@bu.edu \
    --cc=imammedo@redhat.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhao1.liu@intel.com \
    /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