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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50df2b12-18a6-8a11-f57a-d1e4bc04e9cd@linux.microsoft.com>
Date:   Wed, 30 Jun 2021 11:03:05 -0400
From:   Vineeth Pillai <viremana@...ux.microsoft.com>
To:     Wei Liu <wei.liu@...nel.org>
Cc:     Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
        Sunil Muthuswamy <sunilmut@...rosoft.com>,
        Michael Kelley <mikelley@...rosoft.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org
Subject: Re: [PATCH 06/17] mshv: SynIC port and connection hypercalls


>> +
>> +int
>> +hv_call_create_port(u64 port_partition_id, union hv_port_id port_id,
>> +		    u64 connection_partition_id,
>> +		    struct hv_port_info *port_info,
>> +		    u8 port_vtl, u8 min_connection_vtl, int node)
>> +{
>> +	struct hv_create_port *input;
>> +	unsigned long flags;
>> +	int ret = 0;
>> +	int status;
>> +
>> +	do {
>> +		local_irq_save(flags);
>> +		input = (struct hv_create_port *)(*this_cpu_ptr(
>> +				hyperv_pcpu_input_arg));
>> +		memset(input, 0, sizeof(*input));
>> +
>> +		input->port_partition_id = port_partition_id;
>> +		input->port_id = port_id;
>> +		input->connection_partition_id = connection_partition_id;
>> +		input->port_info = *port_info;
>> +		input->port_vtl = port_vtl;
>> +		input->min_connection_vtl = min_connection_vtl;
>> +		input->proximity_domain_info =
>> +			numa_node_to_proximity_domain_info(node);
> This misses the check for NUMA_NO_NODE, so does the function for port
> connection (see below).
>
> I think it would actually be better to leave the check in
> numa_node_to_proximity_domain_info to avoid problems like this.
>
> Of course, adapting this approach means some call sites for that
> function will need to be changed too.
Thanks for catching this and fixing Wei, will roll it into my branch.

~Vineeth


>
> ---8<---
> >From 8705857c62b3e5f13d415736ca8b508c22e3f5ba Mon Sep 17 00:00:00 2001
> From: Wei Liu <wei.liu@...nel.org>
> Date: Wed, 30 Jun 2021 11:08:31 +0000
> Subject: [PATCH] numa_node_to_proximity_domain_info should cope with
>   NUMA_NO_NODE
>
> Signed-off-by: Wei Liu <wei.liu@...nel.org>
> ---
>   include/asm-generic/mshyperv.h | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
> index d9b91b8f63c8..44552b7a02ef 100644
> --- a/include/asm-generic/mshyperv.h
> +++ b/include/asm-generic/mshyperv.h
> @@ -31,10 +31,14 @@ numa_node_to_proximity_domain_info(int node)
>   {
>   	union hv_proximity_domain_info proximity_domain_info;
>   
> -	proximity_domain_info.domain_id = node_to_pxm(node);
> -	proximity_domain_info.flags.reserved = 0;
> -	proximity_domain_info.flags.proximity_info_valid = 1;
> -	proximity_domain_info.flags.proximity_preferred = 1;
> +	proximity_domain_info.as_uint64 = 0;
> +
> +	if (node != NUMA_NO_NODE) {
> +		proximity_domain_info.domain_id = node_to_pxm(node);
> +		proximity_domain_info.flags.reserved = 0;
> +		proximity_domain_info.flags.proximity_info_valid = 1;
> +		proximity_domain_info.flags.proximity_preferred = 1;
> +	}
>   
>   	return proximity_domain_info;
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ