Re: [PATCH] nodedev_hal: fix segfault when virDBusGetSystemBus fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/2013 09:45 AM, Ryota Ozaki wrote:
> Thie patch fixes the segfault:
>     error : nodeStateInitialize:658 : DBus not available,
>       disabling HAL driver: internal error: Unable to get DBus
>       system bus connection: Failed to connect to socket
>       /var/run/dbus/system_bus_socket: No such file or directory
>     error : nodeStateInitialize:719 :  ?:
>     Caught Segmentation violation dumping internal log buffer:
> 
> This segfault occurs at the below VIR_ERROR:
>   failure:
>       if (dbus_error_is_set(&err)) {
>           VIR_ERROR(_("%s: %s"), err.name, err.message);
> 
> When virDBusGetSystemBus fails, the code jumps to the above failure
> path. However, the err variable is not correctly initialized
> before calling virDBusGetSystemBus. As a result, dbus_error_is_set
> may pass over the uninitialized err variable whose name or
> message may point to somewhere unknown memory region, which
> causes a segfault on VIR_ERROR.
> 
> The new code initializes the err variable before calling
> virDBusGetSystemBus.
> 
> Signed-off-by: Ryota Ozaki <ozaki.ryota@xxxxxxxxx>
> ---
>  src/node_device/node_device_hal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

ACK and pushed.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]