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

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 …….

Source: https://www.theregister.com/2021/11/23/windows_server_patching_no_reboot/