Re: [RFC PATCH 0/8] x86_64: Harden compressed kernel, part 1

From: Evgeniy Baskov
Date: Tue Aug 02 2022 - 19:46:09 EST


On 2022-08-02 05:41, Dave Hansen wrote:
On 8/1/22 17:25, Evgeniy Baskov wrote:
On 2022-08-01 19:48, Dave Hansen wrote:
On 8/1/22 09:38, Evgeniy Baskov wrote:
This is the first half of changes aimed to increase security of early
boot code of compressed kernel for x86_64 by enforcing memory protection
on page table level.

Could you share a little more background here?  Hardening is good, but
you _can_ have too much of a good thing.

Is this part of the boot cycle becoming a target for attackers in
trusted boot environments?  Do emerging confidential computing
technologies like SEV and TDX cause increased reliance on compressed
kernel security?

In other words, why is *THIS* important versus all the other patches
floating around out there?

Now compressed kernel code becomes larger, partially because of adding
SEV and TDX, so it worth adding memory protection here.
...

Is it fair to say that the problems here are on the potential,
theoretical side rather than driven by practical, known issues that our
users face?

Partially. We do have known issues because kernel PE image is not compliant
with the MS PE and COFF specification v8.3 referenced by the UEFI specification.
UEFI implementations with stricter PE loaders (e.g. mentioned above) fail to
boot Linux kernel.

As for hardening side, these improvements are indeed just nice-to-haves.
But we believe it is good to have them if they are available for free.

Thanks,
Evgeniy Baskov