Re:OpenBSD: Mandatory enforcement of indirect branch targets
by dataflow on Friday July 14, 2023 @12:31PM
(#36726271)
There's a good question in the comments there that I still don't see the answer to. How does this work if there's an interrupt between the branch and the endbranch? Does the OS need to save/restore the "branchness" bit?
[ Parent
| on HN ]
Re:OpenBSD: Mandatory enforcement of indirect branch targets
by drdrey on Friday July 14, 2023 @12:46PM
(#36726451)
there is no branchness bit, if there's an endbranch you can jump to it
Re:OpenBSD: Mandatory enforcement of indirect branch targets
by dataflow on Friday July 14, 2023 @12:49PM
(#36726483)
Ah so when you return from an interrupt, the check is no longer done?
Re:OpenBSD: Mandatory enforcement of indirect branch targets
by simcop2387 on Friday July 14, 2023 @02:14PM
(#36727797)
I'd assume so since it wouldn't be a call/jmp coming from a computed address in a register. That said I haven't read the documentation for any of this. But interrupts should be having a stack pointer change and other things happening that would be different, which is why they use the IRET instruction and not the RET one.
Re:OpenBSD: Mandatory enforcement of indirect branch targets
by muricula on Friday July 14, 2023 @12:46PM
(#36726465)
Yes, on arm the branch type is saved in SPSR_EL1 in the BTYPE field.
That stands for Saved Program State Register for Kernel Mode (Exception Level 1) and Branch Type.
https://developer.arm.com/documentation/ddi0595/2021-12/AArc...