You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
verify Clang's fortified string routines are called in the kernel #1002
forking #979 which focuses on regressions. cc @kees@gburgessiv@m-gupta
(If we're happy with a new bug, please close #979 as fixed, otherwise close this as a dup of #979).
Kees mentions that the runtime implementations of fortified string routines in the kernel may never have been called in a clang built kernel, irrespective of regressions in #979 ? If that's so, we should figure out what we need to fix and where to leverage this technology. It's probably possible to write a kselftest to help prevent support from regressing.
Thanks for filing! I hear no discomfort with #979's resolution, so I'll close it.
Kees mentions that the runtime implementations of fortified string routines in the kernel may never have been called in a clang built kernel, irrespective of regressions in #979 ?
This depends on the implementation of the routine in question, but yeah, clang won't generate IR for extern inline gnu_inline functions that appear trivially recursive in a particular way. This turns at least some of the kernel's FORTIFY into a nop.
There's some discussion of approaches we can try on #980 (comment). Kees noted that automated testing would be really nice to have here before we start trying to thread this particular needle. I agree with that. :)
Activity
gburgessiv commentedon Apr 24, 2020
Thanks for filing! I hear no discomfort with #979's resolution, so I'll close it.
This depends on the implementation of the routine in question, but yeah, clang won't generate IR for
extern inline gnu_inlinefunctions that appear trivially recursive in a particular way. This turns at least some of the kernel's FORTIFY into a nop.There's some discussion of approaches we can try on #980 (comment). Kees noted that automated testing would be really nice to have here before we start trying to thread this particular needle. I agree with that. :)
nathanchance commentedon May 7, 2020
https://lore.kernel.org/lkml/20200506001453.764332-1-Jason@zx2c4.com/
nathanchance commentedon Apr 28, 2021
@kees had mentioned recently that he was still looking into this?
kees commentedon Apr 28, 2021
Yup, currently investigating this as a part of my memcpy work.
kees commentedon May 12, 2021
This is blocked on an LLVM bug: https://llvm.org/pr41459
kees commentedon May 12, 2021
And blocked on this LLVM bug: https://llvm.org/pr50322
nickdesaulniers commentedon Oct 19, 2021
jotting down notes from trying to run LKDTM:
nathanchance commentedon Apr 19, 2022
This is fixed with https://git.kernel.org/linus/281d0c962752fb40866dd8d4cade68656f34bd1f.
#1583 is tracking the
!X86_32inCONFIG_FORTIFY_SOURCE's entry.