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:   Tue, 28 Dec 2021 14:10:17 +0000
From:   Wei Liu <wei.liu@...nel.org>
To:     Michael Kelley <mikelley@...rosoft.com>
Cc:     sthemmin@...rosoft.com, kys@...rosoft.com, wei.liu@...nel.org,
        decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, arnd@...db.de, tianyu.lan@...rosoft.com,
        linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org,
        linux-arch@...r.kernel.org
Subject: Re: [PATCH 1/2] Drivers: hv: Fix definition of hypercall input &
 output arg variables

On Mon, Dec 27, 2021 at 07:31:54PM -0800, Michael Kelley wrote:
> The percpu variables hyperv_pcpu_input_arg and hyperv_pcpu_output_arg
> have been incorrectly defined since their inception.  The __percpu
> qualifier should be associated with the void * (i.e., a pointer), not
> with the target of the pointer. This distinction makes no difference
> to gcc and the generated code, but sparse correctly complains.  Fix
> the definitions in the interest of general correctness in addition
> to making sparse happy.
> 
> No functional change.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Michael Kelley <mikelley@...rosoft.com>

Good catch. I failed to interpret sparse's complaints.

Both patches queued to hyperv-next. Thanks.

> ---
>  drivers/hv/hv_common.c         | 4 ++--
>  include/asm-generic/mshyperv.h | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> index 7be173a..7477e5a 100644
> --- a/drivers/hv/hv_common.c
> +++ b/drivers/hv/hv_common.c
> @@ -44,10 +44,10 @@
>  u32 hv_max_vp_index;
>  EXPORT_SYMBOL_GPL(hv_max_vp_index);
>  
> -void  __percpu **hyperv_pcpu_input_arg;
> +void * __percpu *hyperv_pcpu_input_arg;
>  EXPORT_SYMBOL_GPL(hyperv_pcpu_input_arg);
>  
> -void  __percpu **hyperv_pcpu_output_arg;
> +void * __percpu *hyperv_pcpu_output_arg;
>  EXPORT_SYMBOL_GPL(hyperv_pcpu_output_arg);
>  
>  /*
> diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
> index 3e2248ac..95b7888 100644
> --- a/include/asm-generic/mshyperv.h
> +++ b/include/asm-generic/mshyperv.h
> @@ -49,8 +49,8 @@ struct ms_hyperv_info {
>  };
>  extern struct ms_hyperv_info ms_hyperv;
>  
> -extern void  __percpu  **hyperv_pcpu_input_arg;
> -extern void  __percpu  **hyperv_pcpu_output_arg;
> +extern void * __percpu *hyperv_pcpu_input_arg;
> +extern void * __percpu *hyperv_pcpu_output_arg;
>  
>  extern u64 hv_do_hypercall(u64 control, void *inputaddr, void *outputaddr);
>  extern u64 hv_do_fast_hypercall8(u16 control, u64 input8);
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ