Files
chipsec-chipsec/drivers
Mathias Krause 6b974e9e29 drivers/linux: fix getting physical address of GDT
Since kernel version 4.12 the GDT as seen by SGDT is only an r/o alias
mapping located at a fixed address not backed by a dedicated kernel
memory allocation. Later kernels moved it further to the "cpu entry
area", yet another alias mapping. All, just to mitigate all too easy
kernel address leaking in the name of KASLR. Anyhow, the fact that these
virtual addresses have no 'struct page' attached prevents us from using
virt_to_phys() to resolve its physical address. A full software page
table walk is required instead.

Luckily, slow_virt_to_phys() does just that. It was introduced in kernel
v3.9 so covers all affected kernels.

This fixes github issue #608.

While at it, extend the switch block to reject invalid descriptor code
arguments to not operate on uninitialized descriptor.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
2021-06-21 16:24:21 -07:00
..
2020-01-16 08:59:09 -08:00
2021-06-17 16:39:36 -07:00