lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 29 Aug 2018 17:14:33 +0200
From:   Radim Krčmář <rkrcmar@...hat.com>
To:     Peng Hao <peng.hao2@....com.cn>
Cc:     pbonzini@...hat.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        wanpeng.li@...mail.com
Subject: Re: [PATCH V3 1/2] kvm/x86 : add coalesced pio support

2018-08-24 19:20+0800, Peng Hao:
> Signed-off-by: Peng Hao <peng.hao2@....com.cn>
> ---
>  include/uapi/linux/kvm.h  | 5 +++--
>  virt/kvm/coalesced_mmio.c | 8 +++++---
>  virt/kvm/kvm_main.c       | 2 ++
>  3 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index b6270a3..9cc56d3 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -420,13 +420,13 @@ struct kvm_run {
>  struct kvm_coalesced_mmio_zone {
>  	__u64 addr;
>  	__u32 size;
> -	__u32 pad;
> +	__u32 pio;

I would prefer to have this as a slightly more compatible

	union {
		__u32 pad;
		__u32 pio;
	};

>  };
>  
>  struct kvm_coalesced_mmio {
>  	__u64 phys_addr;
>  	__u32 len;
> -	__u32 pad;
> +	__u32 pio;

Also, please add a check that "pio <= 1".

This would catch most cases where userspace passed garbage in that field
and we'd also make the remaining bits available for future features.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ