[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SN6PR02MB415728EA80420231DF35BB36D46F2@SN6PR02MB4157.namprd02.prod.outlook.com>
Date: Fri, 12 Jan 2024 03:19:55 +0000
From: Michael Kelley <mhklinux@...look.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"ardb@...nel.org" <ardb@...nel.org>, "hch@...radead.org" <hch@...radead.org>,
"Lutomirski, Andy" <luto@...nel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "thomas.lendacky@....com"
<thomas.lendacky@....com>, "haiyangz@...rosoft.com" <haiyangz@...rosoft.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"mingo@...hat.com" <mingo@...hat.com>, "seanjc@...gle.com"
<seanjc@...gle.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "tglx@...utronix.de" <tglx@...utronix.de>,
"Cui, Dexuan" <decui@...rosoft.com>, "urezki@...il.com" <urezki@...il.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>, "hpa@...or.com" <hpa@...or.com>,
"peterz@...radead.org" <peterz@...radead.org>, "wei.liu@...nel.org"
<wei.liu@...nel.org>, "bp@...en8.de" <bp@...en8.de>, "Rodel, Jorg"
<jroedel@...e.de>, "sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>, "lstoakes@...il.com"
<lstoakes@...il.com>, "x86@...nel.org" <x86@...nel.org>
Subject: RE: [PATCH v3 3/3] x86/hyperv: Make encrypted/decrypted changes safe
for load_unaligned_zeropad()
From: Edgecombe, Rick P <rick.p.edgecombe@...el.com> Sent: Thursday, January 11, 2024 4:27 PM
>
> On Fri, 2024-01-05 at 10:30 -0800, mhkelley58@...il.com wrote:
> > * hv_vtom_set_host_visibility - Set specified memory visible to host.
> > *
> > @@ -521,7 +547,7 @@ static bool hv_vtom_set_host_visibility(unsigned long kbuffer, int pagecount, bo
> >
> > pfn_array = kmalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
> > if (!pfn_array)
> > - return false;
> > + goto err_set_memory_p;
> >
>
> If kmalloc() fails here, and set_memory_p() succeeds below, then
> hv_vtom_set_host_visibility() returns true, but skips all the
> hv_mark_gpa_visibility() work. Shouldn't it return false?
Ooops. Yes. If the kmalloc() fails, need to set "result" to false before
doing the goto. Will fix in the next version.
Michael
Powered by blists - more mailing lists