3 ms·
> As Peter Zijlstra pointed out, there is another, perhaps surprising advantage to removing the unneeded endbr instructions. The kernel limits the functions tha
by saagarjha 5y ago
> 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's symbol table, then call them via an indirect branch, thus bypassing the kernel's limitations. But, with IBT enabled, any function lacking an endbr instruction will no longer be callable in this way.
This is an amusing consequence but of course code that is deliberately trying to violate the GPL an running in the kernel address space is usually more than willing to work around such trivialities, e.g. by patching the kernel's text at runtime to remove the instructions. But maybe now we can call them out for reducing kernel security in addition to being jerks in general :)
- nybble41 5y ago> e.g. by patching the kernel's text at runtime to remove the instructions Or simply by marking the module as GPL even when it isn't. There is plenty of precedent for stronger measures (like embedding a copyrighted & trademarked logo image in a console ROM) being permitted when doing so was made necessary for interoperability. There are decent security-related reasons to make this change, but the prospect of complicating access to select kernel symbols under some questionable, idiosyncratic interpretation of copyright where calling an external library function somehow makes an independently-developed module containing no kernel code a derivative work of the kernel is not one of them.
- bobthebuilders 5y agoYup, this is a great win for free software as proprietary modules have less leeway to call GPL functions.
- nybble41 5y agoIs this sarcasm, or did you just reply to the wrong comment? As an opt-in measure under the control of the user these changes are not unreasonable for certain security contexts, but to the extent that they prevent users from loading the modules they wish to load—including anything (not just proprietary code!) that needs to call arbitrary kernel functions via dynamic dispatch—it's user-hostile and contrary to the principles of free software, not anything to celebrate over.