On Fri, Dec 20, 2024 at 2:39 AM Andrew Cooper andrew.cooper3@citrix.com wrote:
On 20/12/2024 12:27 am, Sedat Dilek wrote:
On Fri, Dec 20, 2024 at 12:26 AM Andrew Cooper andrew.cooper3@citrix.com wrote:
On 19/12/2024 11:10 pm, Sedat Dilek wrote:
On Thu, Dec 19, 2024 at 6:07 PM Sedat Dilek sedat.dilek@gmail.com wrote:
On Thu, Dec 19, 2024 at 5:44 PM Andrew Cooper andrew.cooper3@citrix.com wrote:
On 19/12/2024 4:14 pm, Sedat Dilek wrote: > Hi, > > Linux v6.12.6 will include XEN CVE fixes from mainline. > > Here, I use Debian/unstable AMD64 and the SLIM LLVM toolchain 19.1.x > from kernel.org. > > What does it mean in ISSUE DESCRIPTION... > > Furthermore, the hypercall page has no provision for Control-flow > Integrity schemes (e.g. kCFI/CET-IBT/FineIBT), and will simply > malfunction in such configurations. > > ...when someone uses Clang-kCFI? The hypercall page has functions of the form:
MOV $x, %eax VMCALL / VMMCALL / SYSCALL RET
There are no ENDBR instructions, and no prologue/epilogue for hash-based CFI schemes.
This is because it's code provided by Xen, not code provided by Linux.
The absence of ENDBR instructions will yield #CP when CET-IBT is active, and the absence of hash prologue/epilogue lets the function be used in a type-confused manor that CFI should have caught.
~Andrew
Thanks for the technical explanation, Andrew.
Hope that helps the folks of "CLANG CONTROL FLOW INTEGRITY SUPPORT".
I am not an active user of XEN in the Linux-kernel but I am willing to test when Linux v6.12.6 is officially released and give feedback.
https://wiki.xenproject.org/wiki/Testing_Xen#Presence_test https://wiki.xenproject.org/wiki/Testing_Xen#Commands_for_presence_testing
# apt install -t unstable xen-utils-4.17 -y
# xl list Name ID Mem VCPUs State Time(s) Domain-0 0 7872 4 r----- 398.2
Some basic tests LGTM - see also attached stuff.
If you have any tests to recommend, let me know.
That itself is good enough as a smoke test. Thankyou for trying it out.
If you want something a bit more thorough, try https://xenbits.xen.org/docs/xtf/ (Xen's self-tests)
Grab and build it, and `./xtf-runner -aqq --host` will run a variety of extra codepaths in dom0, without the effort of making/running full guests.
~Andrew
Run on Debian 6.12.5 and my selfmade 6.12.5 and 6.12.6. All tests lead to a reboot in case of Debian or in my kernels to a shutdown.
Can you recommend a specific test?
Oh, that's distinctly less good.
Start with just "example". It's literally a hello world microkernel, but the symptoms you're seeing is a dom0 crash, so it will likely provoke it.
Do you have serial to the machine? If so, boot Xen with `console=com1 com1=115200,8n1` (or com2, as appropriate).
If not and you've only got a regular screen, boot Xen with `vga=,keep noreboot` (comma is important) which might leave enough information on screen to get an idea of what's going on.
Full command line docs at https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html
dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner --list functional xsa | grep xsa-4 test-pv64-xsa-444 test-hvm64-xsa-451 test-hvm64-xsa-454
Is there no xsa-466 test?
No. XSA-466 is really "well don't do that then if it matters".
More generally, not all XSAs are amenable to testing in this way.
~Andrew
RUN example tests on Debian's 6.12.6 kernel.
$ cat /proc/version Linux version 6.12.6-amd64 (debian-kernel@lists.debian.org) (x86_64-linux-gnu-gcc-14 (Debian 14.2.0-11) 14.2.0, GNU ld (GNU Binutils for Debian) 2.43.50.20241215) #1 SMP PREEMPT_DYNAMIC Debian 6.12.6-1 (2024-12-21)
dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner --list example test-hvm32-example test-hvm32pae-example test-hvm32pse-example test-hvm64-example test-pv32pae-example test-pv64-example dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-hvm32-example Executing 'xl create -p tests/example/test-hvm32-example.cfg' Executing 'xl console test-hvm32-example' Executing 'xl unpause test-hvm32-example' --- Xen Test Framework --- Environment: HVM 32bit (No paging) Hello World Test result: SUCCESS
Combined test results: test-hvm32-example SUCCESS dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-hvm32pae-example Executing 'xl create -p tests/example/test-hvm32pae-example.cfg' Executing 'xl console test-hvm32pae-example' Executing 'xl unpause test-hvm32pae-example' --- Xen Test Framework --- Environment: HVM 32bit (PAE 3 levels) Hello World Test result: SUCCESS
Combined test results: test-hvm32pae-example SUCCESS dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-hvm32pse-example Executing 'xl create -p tests/example/test-hvm32pse-example.cfg' Executing 'xl console test-hvm32pse-example' Executing 'xl unpause test-hvm32pse-example' --- Xen Test Framework --- Environment: HVM 32bit (PSE 2 levels) Hello World Test result: SUCCESS
Combined test results: test-hvm32pse-example SUCCESS dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-hvm64-example Executing 'xl create -p tests/example/test-hvm64-example.cfg' Executing 'xl console test-hvm64-example' Executing 'xl unpause test-hvm64-example' --- Xen Test Framework --- Environment: HVM 64bit (Long mode 4 levels) Hello World Test result: SUCCESS
Combined test results: test-hvm64-example SUCCESS dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-pv32pae-example Combined test results: test-pv32pae-example SKIP dileks@iniza:~/src/xtf/git$ sudo ./xtf-runner test-pv64-example Executing 'xl create -p tests/example/test-pv64-example.cfg' Executing 'xl console test-pv64-example' Executing 'xl unpause test-pv64-example' --- Xen Test Framework --- Environment: PV 64bit (Long mode 4 levels) Hello World Test result: SUCCESS
Combined test results: test-pv64-example SUCCESS
Thanks.
Best regards, -Sedat-