[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/10] x86/ucode: Delete the microcode_init() initcall


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Sat, 2 Nov 2024 12:05:54 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730563557; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=n2CDV7e8ydz8WXHNAsmH56z8tCWwjsJOCGkZfFciXGw=; b=S1u0CjJNHp/1roet2yn2jAiCVVCMEAC5E6bx/PVufVtK5fW+v8n0Xa5nkL2k6IDI9+jc4IH+Z97hRO4LHzBGyQ49iQbujSZ2quhvYsLzJ3WtsxwJwGLP8pTVyvU/pXt2Rdzwjx/mmZK5GYuWs2IOyZXtB70lU140TAp0kQjyBtw=
  • Arc-seal: i=1; a=rsa-sha256; t=1730563557; cv=none; d=zohomail.com; s=zohoarc; b=EsGoqlZfo44P6g57kuLH8OYV/TzMSxXMpkOPo85ViW2IVYOK/8BKZnOSCfP2YZgsb9RSzIs3kJN0vA2d1iyILR9GWinzd9LOujIpK6Gux4yTu7YKPRTVRNAOaAmfJ4krIlhbfgVd5B6ZIYN14Q+Gl55btr8JWfhdbDOifHcZwWQ=
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sat, 02 Nov 2024 16:06:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/28/24 05:18, Andrew Cooper wrote:
The comment highlights just how bogus this really is.  Being an initcall, the
boot allocator is long gone, and bootstrap_unmap() is a no-op.

The fact there is nothing to do should be a giant red flag about the validity
of the mappings "being freed".  Indeed, they both constitute use-after-frees.

We could move the size/data/end clobbering into microcode_init_cache() which
is the final consumer of the information, but we're intending to delete these
static variables entirely, and it's less churn to just leave them dangling for
a few patches.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>

After the $N'th rearranging, this could actually be merged into "x86/ucode:
Drop ucode_mod and ucode_blob" with no effect on the intermediate patches.
---

Not sure if this helps, but for clarification sake, the module itself is freed by discard_initial_images() and ucode_mod is __initdata and will be cleaned up with the rest of _initdata. This function is called after the last user of ucode_mod and the call to bootstrap_unmap() perpetuates the assumption that some how the underlying module has remained mapped. There is not any condition where this function does anything that would affect the execution of the hypervisor. It frees nothing and sets the value of a unit local variable that is no longer used shortly before the backing memory is freed.

As to patch ordering, I have no opinion.

Reviewed-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.