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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Nov 2019 11:02:56 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Yang Weijiang <weijiang.yang@...el.com>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, jmattson@...gle.com,
        sean.j.christopherson@...el.com
Cc:     yu.c.zhang@...ux.intel.com, alazar@...defender.com,
        edwin.zhai@...el.com
Subject: Re: [PATCH v7 1/9] Documentation: Introduce EPT based Subpage
 Protection and related ioctls

On 19/11/19 09:49, Yang Weijiang wrote:
> +
> +#define SUBPAGE_MAX_BITMAP   64

Please rename this to KVM_SUBPAGE_MAX_PAGES

> +struct kvm_subpage_info {
> +	__u64 gfn;    /* the first page gfn of the contiguous pages */
> +	__u64 npages; /* number of 4K pages */

This can be

	u32 npages;
	u32 flags;

Check that the flags are 0, and fail the ioctl if they aren't.  This
will make it easy to extend the API in the future.

> +	__u32 access_map[SUBPAGE_MAX_BITMAP]; /* sub-page write-access bitmap array */
> +};

Please make this access_map[0], since the number of entries actually
depends on npages.

Likewise, kvm_arch_vm_ioctl should read the header first, then allocate
memory for the access_map and read into it.  It's probably simpler if
you make kvm_vm_ioctl_get_subpages/kvm_vm_ioctl_set_subpages take
parameters like

int kvm_vm_ioctl_get_subpages(struct kvm *kvm, u64 gfn, u32 npages,
			      u32 *access_map);
int kvm_vm_ioctl_set_subpages(struct kvm *kvm, u64 gfn, u32 npages,
			      u32 *access_map);

Thanks,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ