This article is more than 1 year old

Patching Windows Server without needing to reboot is a handy feature – but it's only available on Azure

Trampolines and Retpoline: Applying patches at the function level

Microsoft has posted details of how its Hotpatching feature applies security patches to Windows Server without requiring a reboot – but although the company said it is working on broader availability, it remains Azure-only.

Credited to "Andrea Allievi & Hotpatch Team," Allievi being a Senior Core OS Engineer at Microsoft, the post explains both the rationale and the technology behind the feature. It is not just about convenience.

"Often, users and system administrators will delay the installation of a patch because of the reboot that is frequently required upon completing the installation. This delay in patching, while seemingly convenient, is actually a security issue," the post published on 19 November explains, referencing a report showing that 42 per cent of exploited vulnerabilities occur after a patch has been released.

Microsoft focused on the problem in the context of Azure host machines. "The instances of Windows Server that power the Azure fleet are required to be highly available. However, we also require these operating system instances to be secure," the post adds. Therefore Hotpatch has been "in use in Azure Host OS for a while," making the technique "battle-tested."

The reboot method of patching is easy to understand: The system shuts down, cleanly terminating all processes, then the binary files which implement the Windows NT kernel are updated, and the processes in the restarted system call functions in the updated files.

Hotpatching is different in kind. According to the team, it "works at the function level, which means that functions are individually patched and not individual files or components." The way this operates is by redirection of calls to the unpatched function to "a patched function belonging to a hotpatch image." This works with x64, ARM64 (new in Windows Server 2022), and 32-bit code.

The path of a Hotpatched function

The path of a Hotpatched function

Implementing this solution requires a Hotpatch engine, "mostly in the NT and Secure Kernel," the engineers explain, the Secure Kernel being part of the operating system that runs in a more secure and isolated environment called VTL1 (Virtual Trust Level 1). The Hotpatch engine identifies patch images, verifies that they match the unpatched base image, and then maps the patch image in the same address space as the base image.

The engine is smart enough to update references to global variables in patched functions to point to the global variables in the base image. Then it performs the patch, causing "functions in the original base image to jump to the corresponding functions in the patch image." This bouncing of code paths is described as "the trampoline."

Patching a system in this way indefinitely would lead to increasing convolution. Therefore, there is a periodic refresh with a new set of base images, implemented as a traditional cumulative update and requiring a reboot. The current documentation does this every three months. There is a hint that even better patching techniques may come. "Hotpatching is one of the first techniques geared to bringing users a reboot-less security update future," the team said.

Windows Server 2022 introduces not only the ARM64 support mentioned above but also compatibility with Retpoline, a return trampoline introduced to overcome Spectre v2 side-channel attacks.

The snag with these features is in the final paragraph of the post. "Hotpatch-based security updates are available to customers running Windows Server 2019 and Windows Server 2022 Azure Edition images in the Azure cloud within the automanage framework," says the team. That is little comfort to the countless other users of Windows Server.

"The hotpatch feature for Azure is great but on-prem servers are long overdue for a replacement or new method of patching that isn't WSUS," commented a customer in July in response, also observing that "every month the server chokes for hours trying to synchronize the WSUS database after updates are released." WSUS is Windows Server Update Services, deployed on business networks to roll out patches internally.

At the time, principal program manager Ned Pyle said that "we have an answer for this coming soon, but I can't say more yet." Now the hotpatch teams says "we are working on bringing hotpatch-based security updates to a wider set of Windows customers." Note that Hotpatch for Azure VMs is still in preview. The documentation described it as "a new way to install updates on supported Windows Server Azure Edition virtual machine."

The impact of Hotpatch could be considerable since it is quicker and less disruptive than the existing patch and reboot cycle, and can be automated without introducing downtime. But Microsoft has not yet stated why it is Azure only. If it is for testing the feature in a controlled environment before more general availability anywhere Windows Server can run, that is understandable. If it is a way of giving Microsoft's cloud an artificial advantage over both on-premises and other public clouds and hosting companies, that would be unwelcome to customers. ®

More about

TIP US OFF

Send us news


Other stories you might like