lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJSP0QXd3zgMYRUQ3kCcUZ+RbZ6SHHn-kc5K4DV9C8LeU2g78A@mail.gmail.com>
Date: Tue, 2 Sep 2025 07:56:36 -0400
From: Stefan Hajnoczi <stefanha@...il.com>
To: Alyssa Ross <hi@...ssa.is>
Cc: "Michael S. Tsirkin" <mst@...hat.com>, Jason Wang <jasowang@...hat.com>, 
	Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, Eugenio Pérez <eperezma@...hat.com>, 
	virtualization@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] virtio_config: clarify output parameters

On Fri, Aug 29, 2025 at 11:10 AM Alyssa Ross <hi@...ssa.is> wrote:
>
> This was ambiguous enough for a broken patch (206cc44588f7 ("virtio:
> reject shm region if length is zero")) to make it into the kernel, so
> make it clearer.
>
> Link: https://lore.kernel.org/r/20250816071600-mutt-send-email-mst@kernel.org/
> Signed-off-by: Alyssa Ross <hi@...ssa.is>
> ---
>  include/linux/virtio_config.h | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@...hat.com>

>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
> index 8bf156dde554..7427b79d6f3d 100644
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
> @@ -193,14 +193,15 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
>  }
>
>  static inline void virtio_get_features(struct virtio_device *vdev,
> -                                      u64 *features)
> +                                      u64 *features_out)
>  {
>         if (vdev->config->get_extended_features) {
> -               vdev->config->get_extended_features(vdev, features);
> +               vdev->config->get_extended_features(vdev, features_out);
>                 return;
>         }
>
> -       virtio_features_from_u64(features, vdev->config->get_features(vdev));
> +       virtio_features_from_u64(features_out,
> +               vdev->config->get_features(vdev));
>  }
>
>  /**
> @@ -326,11 +327,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask)
>
>  static inline
>  bool virtio_get_shm_region(struct virtio_device *vdev,
> -                          struct virtio_shm_region *region, u8 id)
> +                          struct virtio_shm_region *region_out, u8 id)
>  {
>         if (!vdev->config->get_shm_region)
>                 return false;
> -       return vdev->config->get_shm_region(vdev, region, id);
> +       return vdev->config->get_shm_region(vdev, region_out, id);
>  }
>
>  static inline bool virtio_is_little_endian(struct virtio_device *vdev)
>
> base-commit: 07d9df80082b8d1f37e05658371b087cb6738770
> --
> 2.50.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ