Merge pull request #37 from deufrai/better-dmesg-support

Improve PTI detection
This commit is contained in:
Stéphane Lesimple 2018-01-09 19:52:45 +01:00 committed by GitHub
commit d6e4aa43f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -685,7 +685,10 @@ if [ "$opt_live" = 1 ]; then
# RedHat Backport creates a dedicated file, see https://access.redhat.com/articles/3311301
kpti_enabled=$(cat /sys/kernel/debug/x86/pti_enabled 2>/dev/null)
elif dmesg | grep -Eq 'Kernel/User page tables isolation: enabled|Kernel page table isolation enabled'; then
# if we can't find the flag, grep in dmesg
# if we can't find the flag, grep dmesg output
kpti_enabled=1
elif [ -r /var/log/dmesg ] && grep -Eq 'Kernel/User page tables isolation: enabled|Kernel page table isolation enabled' /var/log/dmesg; then
# if we can't find the flag in dmesg output, grep in /var/log/dmesg when readable
kpti_enabled=1
else
kpti_enabled=0