[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b0d93611e8740afbf25870e8b54a8e9@huawei.com>
Date: Thu, 16 Dec 2021 15:12:35 +0000
From: Roberto Sassu <roberto.sassu@...wei.com>
To: "airlied@...ux.ie" <airlied@...ux.ie>,
"kraxel@...hat.com" <kraxel@...hat.com>,
"daniel@...ll.ch" <daniel@...ll.ch>
CC: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"syzbot+e9072e90624a31dfa85f@...kaller.appspotmail.com"
<syzbot+e9072e90624a31dfa85f@...kaller.appspotmail.com>
Subject: RE: [PATCH] drm/virtio: Ensure that objs is not NULL in
virtio_gpu_array_put_free()
> From: Roberto Sassu
> Sent: Monday, December 13, 2021 7:31 PM
> If virtio_gpu_object_shmem_init() fails (e.g. due to fault injection, as it
> happened in the bug report by syzbot), virtio_gpu_array_put_free() could be
> called with objs equal to NULL.
>
> Ensure that objs is not NULL in virtio_gpu_array_put_free(), or otherwise
> return from the function.
Hello
did you have the chance to look at this patch?
Thanks
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Zhong Ronghua
> Cc: stable@...r.kernel.org # 5.13.x
> Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
> Reported-by: syzbot+e9072e90624a31dfa85f@...kaller.appspotmail.com
> Fixes: 377f8331d0565 ("drm/virtio: fix possible leak/unlock
> virtio_gpu_object_array")
> ---
> drivers/gpu/drm/virtio/virtgpu_gem.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c
> b/drivers/gpu/drm/virtio/virtgpu_gem.c
> index 2de61b63ef91..48d3c9955f0d 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_gem.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
> @@ -248,6 +248,9 @@ void virtio_gpu_array_put_free(struct
> virtio_gpu_object_array *objs)
> {
> u32 i;
>
> + if (!objs)
> + return;
> +
> for (i = 0; i < objs->nents; i++)
> drm_gem_object_put(objs->objs[i]);
> virtio_gpu_array_free(objs);
> --
> 2.32.0
Powered by blists - more mailing lists