LWN: Comments on "Kernel support for hardware-based control-flow integrity" https://lwn.net/Articles/900099/ This is a special feed containing comments posted to the individual LWN article titled "Kernel support for hardware-based control-flow integrity". en-us Thu, 09 Oct 2025 01:31:48 +0000 Thu, 09 Oct 2025 01:31:48 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/907597/ https://lwn.net/Articles/907597/ nix <div class="FormattedComment"> The point isn&#x27;t huge in the sense of performance cost: it&#x27;s huge in the sense of complexity cost. This has needed a whole new mechanism in glibc ld.so to identify cases where shared libraries compiled without CET support are loaded at startup or via dlopen into a process which has CET support active: all you can do in that case is to fail the load (IIRC), reducing reliability unless you do a whole-distro rebuild with CET enabled and never run libraries obtained from any other source. Every single thing involving unusual patterns of control flow needed (often extremely tricky) modification. Some things (like setjmp) involve fixed-size structures baked into user programs: a perennial source of pain, but this made that pain a bit worse. And so on.<br> </div> Fri, 09 Sep 2022 19:59:08 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/907579/ https://lwn.net/Articles/907579/ jepsis <div class="FormattedComment"> &quot;But the cost of those shadow stack thingy is huge.&quot;<br> <p> Not so huge. Many Android phones have these enabled. Chrome OS too. Enabling CFI is strongly recommended on Android devices.<br> </div> Fri, 09 Sep 2022 14:30:45 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/904233/ https://lwn.net/Articles/904233/ alkbyby <div class="FormattedComment"> Well, because returns are much easier to make more robust. We don&#x27;t just return to any call site but to exact call site that was used for this specific stack frame.<br> <p> Compared to that forward edge stuff looks weak. And I&#x27;d argue, what is the point building feature that is immediately ~useless from the start.<br> <p> But the cost of those shadow stack thingy is huge. It is not just debuggers and criu. Exception handling too. Various forms of longjmp (yes, AFAIR standard only allows to it to &quot;skip&quot; call frames, but in practice some folk have used it for more advanced means, and those will break). {make,swap}context and friends will break too, I think. And some people have built useful software around those too. Are we saying non-standard control flow now requires a syscall (in our still crazy times when syscall latency is sky-high, sadly)<br> <p> Also I am curious how that works or doesn&#x27;t work with dlopen-ed codes. If my initial set of modules (executable + .so-s) are compatible, but then I dlopen something legacy what happens ?<br> <p> </div> Tue, 09 Aug 2022 01:18:23 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/900878/ https://lwn.net/Articles/900878/ tamiko <div class="FormattedComment"> Threaded INTERCAL :-)<br> </div> Tue, 12 Jul 2022 14:23:45 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/900789/ https://lwn.net/Articles/900789/ scientes <div class="FormattedComment"> There is a joke language with COME FROM, and if you have multiple of these attached to the same label it forks.<br> </div> Tue, 12 Jul 2022 02:09:13 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/900734/ https://lwn.net/Articles/900734/ Wol <div class="FormattedComment"> What about the &quot;RETURN TO&quot; instruction?<br> <p> Istr a couple of languages where you could return to a different label in the caller than the original call site ...<br> <p> Cheers,<br> Wol<br> </div> Mon, 11 Jul 2022 16:50:23 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/900726/ https://lwn.net/Articles/900726/ Bigos <div class="FormattedComment"> At least on architectures with fixed-size instructions (like arm64) a simpler solution would be to look back one instruction to check whether it is a call instruction. On x86-64 that would be trickier.<br> <p> Still, that would only help checking whether the return destination is &quot;a&quot; call-site, not that it is &quot;the&quot; call-site that originated the call. Maybe that was not deemed useful enough? You could still return to the middle of any function, even though the return destination is restricted to call-sites.<br> </div> Mon, 11 Jul 2022 16:15:54 +0000 Kernel support for hardware-based control-flow integrity https://lwn.net/Articles/900723/ https://lwn.net/Articles/900723/ willy <div class="FormattedComment"> There&#x27;s no real difference between CALL and RET. Both change the IP to a different location and both need the same protection. Why did the HW vendors feel the need to invent different mechanisms instead of making every CALL insn be followed by an ENDBR insn so they could verify a RET was returning to _a_ callsite?<br> </div> Mon, 11 Jul 2022 15:58:14 +0000