Messages in this thread | | | From | Miguel Ojeda <> | Date | Wed, 11 Oct 2023 19:44:23 +0200 | Subject | Re: [PATCH] x86: Enable IBT in Rust if enabled in C |
| |
On Tue, Oct 10, 2023 at 12:43 AM Matthew Maurer <mmaurer@google.com> wrote: > > These flags are not made conditional on compiler support because at the > moment exactly one version of rustc supported, and that one supports > these flags. > > Building without these additional flags will manifest as objtool > printing a large number of errors about missing ENDBR and if CFI is > enabled (not currently possible) will result in incorrectly structured > function prefixes. > > Signed-off-by: Matthew Maurer <mmaurer@google.com> > --- > > Split out the IBT additions as per > https://lkml.kernel.org/linux-fsdevel/CANiq72kK6ppBE7j=z7uua1cJMKaLoR5U3NUAZXT5MrNEs9ZhfQ@mail.gmail.com/
Thanks a lot Matthew for this! It is great to see those warnings finally go away.
I have added the `objtool` pass to the intermediate Rust object files and, with that + this patch applied + IBT enabled (but not rethunk/retpoline), the only thing I see is:
samples/rust/rust_print.o: warning: objtool: init_module(): not an indirect call target samples/rust/rust_print.o: warning: objtool: cleanup_module(): not an indirect call target
But we can fix those independently of this (ideally we want to reuse the C macros, rather than putting more complexity in `module!`), so:
Acked-by: Miguel Ojeda <ojeda@kernel.org>
I will send the patch for adding `objtool`.
Cheers, Miguel
| |