[all-commits] [llvm/llvm-project] 5658bc: [lldb][Linux] Add Control Protection Fault signal ...

David Spickett via All-commits all-commits at lists.llvm.org
Tue Jan 21 01:25:03 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5658bc4ae75497edc5ec7c934931c8681d33fac8
      https://github.com/llvm/llvm-project/commit/5658bc4ae75497edc5ec7c934931c8681d33fac8
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
    M lldb/test/API/linux/aarch64/gcs/TestAArch64LinuxGCS.py
    M lldb/test/API/linux/aarch64/gcs/main.c

  Log Message:
  -----------
  [lldb][Linux] Add Control Protection Fault signal (#122917)

This will be sent by Arm's Guarded Control Stack extension when an
invalid return is executed.

The signal does have an address we could show, but it's the PC at which
the fault occured. The debugger has plenty of ways to show you that
already, so I've left it out.

```
(lldb) c
Process 460 resuming
Process 460 stopped
* thread #1, name = 'test', stop reason = signal SIGSEGV: control protection fault
    frame #0: 0x0000000000400784 test`main at main.c:57:1
   54  	  afunc();
   55  	  printf("return from main\n");
   56  	  return 0;
-> 57  	}
(lldb) dis
<...>
->  0x400784 <+100>: ret
```

The new test case generates the signal by corrupting the link register
then attempting to return. This will work whether we manually enable GCS
or the C library does it for us.

(in the former case you could just return from main and it would fault)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list