lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALqoU4y3rw5a=dBMZp4kBc9pi6EL0H99HE3aWo72Ko6vPsYQQw@mail.gmail.com>
Date:   Thu, 4 Jan 2018 14:13:17 -0800
From:   lepton <ytht.net@...il.com>
To:     linux-kernel@...r.kernel.org
Subject: Some linux kernel with KAISER/KPTI patch can't work under qemu + haxm.

It seems for some reason, some linux kernel with KAISER/KPTI patch
can't work with qemu + haxm.
The mainline kernel from Linus is fine. But the patch to 4.4/4.10 doesn't work.

I am not familiar with HAXM and KPTI either. so not sure if this is a
qemu bug or KPTI bug or haxm bug.

The same kernel works fine under qemu + kvm.

This is the way to reproduce it:

1. Download qemu for windows, follow instructions here:

https://www.qemu.org/2017/11/22/haxm-usage-windows/

2. Build a kernel with KAISER/KPTI,  I am using kernel here:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/log/?h=linux-4.4.y
Or follow instruction here to build a 4.10 kernel:
https://github.com/IAIK/KAISER/tree/master/KAISER

3. Build an ext2 image which has a simple init:
dd of=img count=8192 bs=4096 if=/dev/zero
mke2fs img
gcc --static -o init init.c
debugfs -R "write init init" -w img
cat init.c
#include <stdio.h>
#include <time.h>

int main()
{
        while(1) {
                printf("This is init %d\n", time(NULL));
                sleep(3600);
        }
}

4. copy kernel and disk image generated from 3 to windows and run it:
qemu-system-x86_64.exe -kernel bzImage -hda img -append "init=/init
root=/dev/sda" -serial stdio -accel hax

You will see kernel panic or "vpu shutdown reqeust" to qemu.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ