From: Roberto Sassu <roberto.sassu@huawei.com>
To: "airlied@linux.ie" <airlied@linux.ie>,
"kraxel@redhat.com" <kraxel@redhat.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"syzbot+e9072e90624a31dfa85f@syzkaller.appspotmail.com"
<syzbot+e9072e90624a31dfa85f@syzkaller.appspotmail.com>
Subject: RE: [PATCH] drm/virtio: Ensure that objs is not NULL in virtio_gpu_array_put_free()
Date: Thu, 16 Dec 2021 15:12:35 +0000 [thread overview]
Message-ID: <4b0d93611e8740afbf25870e8b54a8e9@huawei.com> (raw)
In-Reply-To: <20211213183122.838119-1-roberto.sassu@huawei.com>
> 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@vger.kernel.org # 5.13.x
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> Reported-by: syzbot+e9072e90624a31dfa85f@syzkaller.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
next prev parent reply other threads:[~2021-12-16 15:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-13 18:31 [PATCH] drm/virtio: Ensure that objs is not NULL in virtio_gpu_array_put_free() Roberto Sassu
2021-12-16 15:12 ` Roberto Sassu [this message]
2022-01-18 6:56 ` Gerd Hoffmann
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=4b0d93611e8740afbf25870e8b54a8e9@huawei.com \
--to=roberto.sassu@huawei.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+e9072e90624a31dfa85f@syzkaller.appspotmail.com \
--cc=virtualization@lists.linux-foundation.org \
/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