qemu-devel
[Top][All Lists]
Advanced

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

Re: Use of g_return_if_fail(), g_return_val_if_fail()


From: Stefan Hajnoczi
Subject: Re: Use of g_return_if_fail(), g_return_val_if_fail()
Date: Tue, 17 Nov 2020 17:02:48 +0000

On Tue, Nov 17, 2020 at 04:14:38PM +0100, Markus Armbruster wrote:
> * block/export/vhost-user-blk-server.c:270:    g_return_val_if_fail(len <= 
> sizeof(struct virtio_blk_config), -1);
> 
>   Stefan, why is len > sizeof(struct virtio_blk_config) a programming
>   error?
> 
>   Why is returning safe?

Thanks for pointing this out. The vhost-user frontend passed an invalid
len and we're validating input. This and the other instances in
vhost-user config function in contrib/ should be replaced with explicit
input validation.

I'll send a patch.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]