Issue 89670
Summary Sanitizer handler calls emitted without regard to `-mregparm`
Labels new issue
Assignees
Reporter kees
    When sanitizer calls are emitted, the `-mregparm=3` option used by the Linux kernel appears to be ignored. For example, here is a build where the argument are being pushed instead of placed in `%eax` and `%edx` (from `lkdtm_ARRAY_BOUNDS`):

```asm
 0xc18e3a5a <+202>:   push   %ebx
   0xc18e3a5b <+203>:   push $0xc26001a0
   0xc18e3a60 <+208>:   call   0xc157d430 <__ubsan_handle_out_of_bounds>
```

The kernel's handler isn't expecting them on the stack. For example, this is setting a bit in the sanitizer's passed-in data structure (from `__ubsan_handle_out_of_bounds`):

```asm
   0xc157d491 <+97>: btsl   $0x1f,%ds:0x4(%eax)
   0xc157d497 <+103>:   jae    0xc157d4a1 <__ubsan_handle_out_of_bounds+113>

```

https://github.com/KSPP/linux/issues/350
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to