id = 1376 title = "x86 LSL and LAR fault" state = "opened" created_at = "2022-12-16T07:56:37.974Z" closed_at = "n/a" labels = ["accel: TCG", "target: i386"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1376" host-os = "Windows 10 20H2" host-arch = "x86" qemu-version = "7.1.90 (v7.2.0-rc0)" guest-os = "None" guest-arch = "x86" description = """From the description of LSL and LAR instructions in manual, `If the segment descriptor cannot be accessed or is an invalid type for the instruction, the ZF flag is cleared and no value is loaded in the destination operand.`. When it happens at the CPU, it seems they do nothing (nop). However, in QEMU, it crashes.""" reproduce = """1. Compile this code ``` void main() { asm("mov rax, 0xa02e698e741f5a6a"); asm("mov rbx, 0x20959ddd7a0aef"); asm("lsl ax, bx"); } ``` 2. Execute. QEMU crashes but CPU does not. This problem happens with LAR, too.""" additional = """This bug is discovered by research conducted by KAIST SoftSec."""