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]
Message-ID: <MWHPR21MB159300A5BB5146AD54684954D7AE9@MWHPR21MB1593.namprd21.prod.outlook.com>
Date:   Mon, 4 Oct 2021 02:39:51 +0000
From:   Michael Kelley <mikelley@...rosoft.com>
To:     Tianyu Lan <ltykernel@...il.com>,
        KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        Dexuan Cui <decui@...rosoft.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>,
        "hpa@...or.com" <hpa@...or.com>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "luto@...nel.org" <luto@...nel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "arnd@...db.de" <arnd@...db.de>,
        "brijesh.singh@....com" <brijesh.singh@....com>,
        "jroedel@...e.de" <jroedel@...e.de>,
        Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        "thomas.lendacky@....com" <thomas.lendacky@....com>,
        "pgonda@...gle.com" <pgonda@...gle.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "rppt@...nel.org" <rppt@...nel.org>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "saravanand@...com" <saravanand@...com>,
        "aneesh.kumar@...ux.ibm.com" <aneesh.kumar@...ux.ibm.com>,
        "rientjes@...gle.com" <rientjes@...gle.com>,
        "tj@...nel.org" <tj@...nel.org>
CC:     "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        vkuznets <vkuznets@...hat.com>,
        "konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
        "hch@....de" <hch@....de>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "joro@...tes.org" <joro@...tes.org>,
        "parri.andrea@...il.com" <parri.andrea@...il.com>,
        "dave.hansen@...el.com" <dave.hansen@...el.com>
Subject: RE: [PATCH V6 7/8] Drivers: hv: vmbus: Add SNP support for VMbus
 channel initiate message

From: Tianyu Lan <ltykernel@...il.com> Sent: Saturday, October 2, 2021 7:40 AM
> 
> 
> On 10/2/2021 9:26 PM, Michael Kelley wrote:
> >> @@ -303,10 +365,26 @@ void vmbus_disconnect(void)
> >>   		vmbus_connection.int_page = NULL;
> >>   	}
> >>
> >> -	hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[0]);
> >> -	hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[1]);
> >> -	vmbus_connection.monitor_pages[0] = NULL;
> >> -	vmbus_connection.monitor_pages[1] = NULL;
> >> +	if (hv_is_isolation_supported()) {
> >> +		memunmap(vmbus_connection.monitor_pages[0]);
> >> +		memunmap(vmbus_connection.monitor_pages[1]);
> > The matching memremap() calls are made in vmbus_connect() only in the
> > SNP case.  In the non-SNP case, monitor_pages and monitor_pages_original
> > are the same, so you would be doing an unmap, and then doing the
> > set_memory_encrypted() and hv_free_hyperv_page() using an address
> > that is no longer mapped, which seems wrong.   Looking at memunmap(),
> > it might be a no-op in this case, but even if it is, making them conditional
> > on the SNP case might be a safer thing to do, and it would make the code
> > more symmetrical.
> >
> 
> Yes, memumap() does nothing is the non-SNP CVM and so I didn't check CVM
> type here. I will add the check in the next version.
> 
> Thanks.
> 

I would also be OK with just adding a comment to that effect, just so someone
looking at the code in the future understands that there's not a problem.
Your call.

Michael

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ