[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ui/dbus: fix buffer-overflow detected by ASAN
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] ui/dbus: fix buffer-overflow detected by ASAN |
Date: |
Wed, 22 Dec 2021 20:11:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
On 12/22/21 15:40, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> On the last added dbus patch, I left a tiny BO:
>
> ==441487==ERROR: AddressSanitizer: heap-buffer-overflow on address
> 0x611000025a70 at pc 0x7f0817bb764c bp 0x7ffde672ae60 sp 0x7ffde672ae58
> WRITE of size 8 at 0x611000025a70 thread T0
> #0 0x7f0817bb764b in dbus_vc_class_init ../ui/dbus.c:401
>
> A cookie for ASAN! not you C :)
>
Fixes: 7f767ca35e5 ("ui/dbus: register D-Bus VC handler")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> ui/dbus.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/ui/dbus.c b/ui/dbus.c
> index b2c1c9fb522c..0074424c1fed 100644
> --- a/ui/dbus.c
> +++ b/ui/dbus.c
> @@ -405,6 +405,7 @@ dbus_vc_class_init(ObjectClass *oc, void *data)
> static const TypeInfo dbus_vc_type_info = {
> .name = TYPE_CHARDEV_VC,
> .parent = TYPE_CHARDEV_DBUS,
> + .class_size = sizeof(DBusVCClass),
> .class_init = dbus_vc_class_init,
> };
>