LWN: Comments on "Indirect branch tracking for Intel CPUs" https://lwn.net/Articles/889475/ This is a special feed containing comments posted to the individual LWN article titled "Indirect branch tracking for Intel CPUs". en-us Mon, 20 Oct 2025 03:25:39 +0000 Mon, 20 Oct 2025 03:25:39 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Indirect branch tracking for Intel CPUs https://lwn.net/Articles/904016/ https://lwn.net/Articles/904016/ josephcsible <div class="FormattedComment"> I stand corrected: it turns out that the Linux kernel sets NOTRACK_EN=0, which makes that prefix ineffective. I wonder whether a similar goal could be accomplished by using the shadow stack manipulation instructions and then doing what&#x27;s basically a retpoline, though.<br> </div> Fri, 05 Aug 2022 16:26:57 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/898053/ https://lwn.net/Articles/898053/ josephcsible <div class="FormattedComment"> <font class="QuotedText">&gt; It is a common technique for proprietary modules to look up the non-exported functions they need in the kernel&#x27;s symbol table, then call them via an indirect branch, thus bypassing the kernel&#x27;s limitations. But, with IBT enabled, any function lacking an endbr instruction will no longer be callable in this way.</font><br> <p> This won&#x27;t stop that. An indirect branch instruction can have a NOTRACK prefix, which suppresses IBT for just that one branch. The proprietary modules will just start using that prefix on their branches, and they can carry on just as before.<br> </div> Thu, 16 Jun 2022 01:50:42 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/891003/ https://lwn.net/Articles/891003/ calumapplepie <div class="FormattedComment"> Actually, assuming you mean a physical book, it&#x27;s totally fine for you to take that edited version and sell it. You own the book, after all: the author got her cut, and the publisher theirs. Trademark law MIGHT get involved, but as far as copyright is concerned, since you aren&#x27;t diluting the market of the original, you&#x27;re golden.<br> </div> Tue, 12 Apr 2022 04:20:52 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890964/ https://lwn.net/Articles/890964/ flussence <div class="FormattedComment"> <font class="QuotedText">&gt; Cool, then dynamic linking does not create a derivative work and the GPL is pointless. Microsoft and Amazon are free to take away your software freedom as long as the open source components are in separate files. </font><br> <p> I think Microsoft would vastly prefer the opposite to be true, given that they could&#x27;ve sued Wine users out of existence for using their ABIs if it were.<br> </div> Mon, 11 Apr 2022 15:14:45 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890950/ https://lwn.net/Articles/890950/ anselm <blockquote><em>Dynamic linking is static after the linking has happened.</em></blockquote> <p> Yes, but the result isn't distributed to others, so copyright doesn't kick in. FWIW, the GPL explicitly says that, on your own machine, you get to do whatever you want with the code, which would presumably include dynamically linking stuff to it. </p> <p> IOW, I'm perfectly free to take my own copy of <em>Harry Potter</em> and replace all occurrences of “Albus Dumbledore” with “Alfred E. Newman”. As long as I don't distribute the result to anybody else, the fact that this has created a “derived work” of the original book is of concern to nobody except myself. </p> Mon, 11 Apr 2022 14:04:54 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890887/ https://lwn.net/Articles/890887/ LtWorf <div class="FormattedComment"> Dynamic linking is static after the linking has happened.<br> <p> Like there is a statically linked file on disk, there is a statically linked file in RAM.<br> </div> Mon, 11 Apr 2022 11:09:46 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890728/ https://lwn.net/Articles/890728/ immibis <div class="FormattedComment"> That&#x27;s what the AGPL is for<br> </div> Fri, 08 Apr 2022 14:29:21 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890725/ https://lwn.net/Articles/890725/ kronat <div class="FormattedComment"> <font class="QuotedText">&gt; Microsoft and Amazon are free to take away your software freedom as long as the open source components are in separate files. </font><br> <p> s/separate files/in the cloud, and problem solved, without caring about linking.<br> </div> Fri, 08 Apr 2022 14:10:53 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890639/ https://lwn.net/Articles/890639/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; Do the library header files contain a non-trivial amount of in-line code ...</font><br> <p> a) Non-trivial code shouldn&#x27;t be inlined. b) This has no bearing on the question of &quot;GPL-only&quot; kernel symbols as inline code isn&#x27;t accessed through the symbol table. c) Inline code in headers files would have no effect on modules distributed in source form (including obfuscated source), as the source distribution doesn&#x27;t include those headers. d) If the inclusion of certain nontrivial inline code is required for the interoperability for a binary module distribution this could reasonably be argued to be fair use.<br> </div> Thu, 07 Apr 2022 16:04:31 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890633/ https://lwn.net/Articles/890633/ Wol <div class="FormattedComment"> Question: Do the library header files contain a non-trivial amount of in-line code ...<br> <p> Cue endless bikeshedding about the meaning of &quot;non-trivial&quot; :-)<br> <p> Cheers,<br> Wol<br> </div> Thu, 07 Apr 2022 15:22:34 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890525/ https://lwn.net/Articles/890525/ sfeam <div class="FormattedComment"> &quot;dynamic linking does not create a derivative work&quot; - probably correct, but argued about endlessly.<br> <p> &quot;and the GPL is pointless&quot; - Maybe you meant the LGPL? In which case I agree with you; the LGPL is in essence identical to the GPL with the addition of a promise not to get into the above endless argument. <br> </div> Thu, 07 Apr 2022 00:28:46 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890522/ https://lwn.net/Articles/890522/ immibis <div class="FormattedComment"> Cool, then dynamic linking does not create a derivative work and the GPL is pointless. Microsoft and Amazon are free to take away your software freedom as long as the open source components are in separate files. <br> </div> Wed, 06 Apr 2022 23:21:11 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890482/ https://lwn.net/Articles/890482/ nybble41 <div class="FormattedComment"> A program that references a function or variable from some other software is no more a &quot;derivative work&quot; of that external code than a research paper is a &quot;derivative work&quot; of all the other papers cited in its bibliography.<br> <p> From 17 U.S.C. § 101 &lt;<a href="http://www.copyright.gov/title17/92chap1.html#101">http://www.copyright.gov/title17/92chap1.html#101</a>&gt;:<br> <p> <font class="QuotedText">&gt; A “derivative work” is a work based upon one or more preexisting works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which a work may be recast, transformed, or adapted. A work consisting of editorial revisions, annotations, elaborations, or other modifications, which, as a whole, represent an original work of authorship, is a “derivative work”.</font><br> <p> What all the examples have in common is that they actually incorporate the original work—not just a reference but the actual creative expression in some form or another—as part of the derivative work. Source code or dynamically linked object code which merely *references* some external API is not a &quot;recast, transformed, or adapted&quot; version of that other software in the form in which it is distributed and does not resemble any of the examples given here.<br> <p> I am not your lawyer, this is not legal advice, yada yada, but IMHO the idea that your original loadable kernel module should be treated as a derivative work of the kernel just because it *references* certain kernel APIs by name is completely without basis under any reasonable interpretation of US copyright law.<br> </div> Wed, 06 Apr 2022 18:04:40 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890471/ https://lwn.net/Articles/890471/ immibis <div class="FormattedComment"> All derivative works of the kernel must be GPLv2 - that&#x27;s how the GPL works. AFAIK Linus&#x27;s opinion is that if you only use non-GPL-marked exported functions - functions you might expect to find in any kernel - then your module is not a derivative work of Linux in particular, but GPL exports are functions that are sufficiently entangled with Linux in particular that you can&#x27;t reasonably claim your driver is not derived from Linux.<br> </div> Wed, 06 Apr 2022 16:34:19 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890470/ https://lwn.net/Articles/890470/ immibis <div class="FormattedComment"> Aren&#x27;t they already in violation of copyright by being non-GPL derivative works of the kernel?<br> <p> I believe common opinion is settled: exported functions form an arms-length public API, but if you go digging in deeply, you&#x27;re a derivative work. Of course, that has not been tested in court.<br> </div> Wed, 06 Apr 2022 16:32:13 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/890041/ https://lwn.net/Articles/890041/ developer122 <div class="FormattedComment"> On philosophical grounds I also half-object to the indifference about what licence that code is under. There&#x27;s no love for fellow copyleft brethren who aren&#x27;t specifically GPL. (despite Torvalds&#x27; insistence on getting changes back being his real only aim)<br> <p> Half-object because there would be *some* maintenance burden to making changes for out of tree code. The kernel already has to periodically sync against other upstream projects whose code it uses.<br> </div> Sat, 02 Apr 2022 01:45:27 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889961/ https://lwn.net/Articles/889961/ jamescrake-merani <div class="FormattedComment"> Probably in the hope that one of the revisions will actually get noticed. But personally that hope would be running very thin if I were doing that.<br> </div> Fri, 01 Apr 2022 10:28:20 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889958/ https://lwn.net/Articles/889958/ andy_shev <div class="FormattedComment"> What does motivates the author to send 30 versions if no getting any comments?<br> </div> Fri, 01 Apr 2022 09:46:06 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889948/ https://lwn.net/Articles/889948/ Villemoes <div class="FormattedComment"> <font class="QuotedText">&gt; For example, the kernel gained support for a compiler-implemented IBT mechanism during the 5.13 development cycle. In this mode, the compiler routes every indirect branch through a &quot;jump table&quot;, ensuring that the target is not only meant to be reached by indirect branches, but that the prototype of the called function matches what the caller is expecting. This approach works, at the cost of a fair amount of compile-time and run-time overhead. </font><br> <p> That mechanism also proactively prevents attackers from gaining control over the machine by inducing NULL pointer derefs (and who knows what other malfunctions) in perfectly fine C code. If you consider enabling that, make sure none of the code included in your build relies on function pointer (in)equality testing.<br> </div> Fri, 01 Apr 2022 07:35:44 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889942/ https://lwn.net/Articles/889942/ donald.buczek <div class="FormattedComment"> Good question. It looks like Make Linux Fast Again benchmarks find only 2% gain (10% maximum on some specific tests) and that you don&#x27;t perceive a difference during normal interactive usage outside of benchmarks. [1] [2] [...]<br> <p> [1]: <a href="https://wonky.computer/post/make-linux-fast-again/">https://wonky.computer/post/make-linux-fast-again/</a><br> [2]: <a href="https://www.linux-community.de/ausgaben/linuxuser/2019/08/schnell-oder-sicher/">https://www.linux-community.de/ausgaben/linuxuser/2019/08...</a> (german)<br> </div> Fri, 01 Apr 2022 04:56:50 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889940/ https://lwn.net/Articles/889940/ milesrout <div class="FormattedComment"> I often wonder how much faster my system would be if *all* of these layers upon layers of security mitigations were removed. Would it be 10% faster? 30% faster? All to protect against security issues that almost always come down to running untrusted code on my machine or something to do with web browsers. <br> </div> Fri, 01 Apr 2022 04:02:21 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889897/ https://lwn.net/Articles/889897/ donald.buczek <div class="FormattedComment"> I think, kallsym_lookup_name itself is no longer exported. But you can work around that, too.<br> <p> There are legitimate reasons to call a non-exported kernel function from a module. E.g. when you create a module to install a ftrace-based wrapper around a kernel function with a security problem because you can&#x27;t immediately reboot into a fixed kernel for one reason or another and you are not prepared for live patching.<br> <p> We recently had to do that [1] and needed to work around a missing kallsym_lookup_name, which we did with register_kprobe.<br> <p> The attempt of the kernel to restrict modules reminds me of DRM. You don&#x27;t really succeed, bad guys work around anyway, but you make life harder for legitimate users.<br> <p> [1]: <a href="https://github.molgen.mpg.de/mariux64/fix-lpp/blob/main/fix-lpp/fix-lpp.c">https://github.molgen.mpg.de/mariux64/fix-lpp/blob/main/f...</a><br> </div> Thu, 31 Mar 2022 20:25:49 +0000 Loadable kernel modules could be vetted https://lwn.net/Articles/889895/ https://lwn.net/Articles/889895/ Sesse <div class="FormattedComment"> While it&#x27;s at it, perhaps it could check for the HLT opcode on a taken path… =)<br> </div> Thu, 31 Mar 2022 19:49:24 +0000 Loadable kernel modules could be vetted https://lwn.net/Articles/889893/ https://lwn.net/Articles/889893/ sdalley <div class="FormattedComment"> Maybe the kernel module loader could check for any such IBT-fiddling instruction opcodes before permitting the load?<br> </div> Thu, 31 Mar 2022 19:02:12 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889891/ https://lwn.net/Articles/889891/ mb <div class="FormattedComment"> If that&#x27;s the case, then<br> <p> func = kallsym_lookup_name(&quot;unexported_function&quot;);<br> (*func)(args);<br> <p> would also be a DMCA violation already.<br> <p> The hypothesis was: IBT could to be used to technically prevent the illegal kallsym_lookup_name.<br> But can it prevent it?<br> </div> Thu, 31 Mar 2022 18:28:14 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889890/ https://lwn.net/Articles/889890/ JoeBuck <div class="FormattedComment"> Seems that would be a blatant DMCA violation in the US (distributing a mechanism to bypass copyright protection), though perhaps it would be considered against the spirit of free software for the kernel developers to enforce that?<br> <p> </div> Thu, 31 Mar 2022 18:19:01 +0000 Indirect branch tracking for Intel CPUs https://lwn.net/Articles/889877/ https://lwn.net/Articles/889877/ Hello71 <div class="FormattedComment"> <font class="QuotedText">&gt; As Peter Zijlstra pointed out, there is another, perhaps surprising advantage to removing the unneeded endbr instructions. The kernel limits the functions that are available to loadable modules, and proprietary modules are limited even further. It is a common technique for proprietary modules to look up the non-exported functions they need in the kernel&#x27;s symbol table, then call them via an indirect branch, thus bypassing the kernel&#x27;s limitations. But, with IBT enabled, any function lacking an endbr instruction will no longer be callable in this way. </font><br> <p> Why can&#x27;t the crap module simply turn off IBT before calling the function (and hopefully turn it back on afterwards)?<br> </div> Thu, 31 Mar 2022 16:35:13 +0000