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:   Fri, 16 Dec 2022 16:56:47 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Li kunyu <kunyu@...china.com>
Cc:     pbonzini@...hat.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: kvm_main: Remove unnecessary (void*) conversions

On Tue, Dec 13, 2022, Li kunyu wrote:
> void * pointer assignment does not require a forced replacement.
> 
> Signed-off-by: Li kunyu <kunyu@...china.com>
> ---
>  virt/kvm/kvm_main.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index fab4d3790578..1682b269ad4a 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -3861,7 +3861,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu)
>  #ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
>  static int vcpu_get_pid(void *data, u64 *val)
>  {
> -	struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data;
> +	struct kvm_vcpu *vcpu = data;
>  	*val = pid_nr(rcu_access_pointer(vcpu->pid));

Unrelated to your patch: doesn't this need proper RCU protection?  E.g. if
KVM_RUN changes vcpu->pid between the read and dereference in pid_nr(), and puts
the last reference to the old pid.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ