Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949378 - sys-devel/gcc-14.2.1_p20241221[cet]: libgccjit.so.0 lacks CET markings
Summary: sys-devel/gcc-14.2.1_p20241221[cet]: libgccjit.so.0 lacks CET markings
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 949404
  Show dependency tree
 
Reported: 2025-02-06 22:24 UTC by Maciej S. Szmigiero
Modified: 2025-02-07 21:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2025-02-06 22:24:05 UTC
Tried building sys-devel/gcc-14.2.1_p20241221 with USE="cet" two times, unfortunately each time libgccjit.so.0 lacks CET/shadow stack markings:
> $ readelf -n /usr/lib/gcc/x86_64-pc-linux-gnu/14/libgccjit.so.0 | grep -q -a SHSTK
> (no output)
This means that any program that this library is loaded into (for example Emacs) cannot ever have CET enforcement since such enforcement requires that all of its library dependencies carry appropriate markings.

I'm not sure if this is a Gentoo or an upstream bug, but reporting here since the sys-devel/gcc ebuild clearly has a "cet" USE flag.
Comment 1 Maciej S. Szmigiero 2025-02-06 22:41:43 UTC
Sorry, my bad, that CET testing command line (coming from a script) accidentally kept "-q" as a grep option, and the library does in fact have CET support:
> $ readelf -n /usr/lib/gcc/x86_64-pc-linux-gnu/14/libgccjit.so.0 | grep -a SHSTK 
>      Properties: x86 feature: IBT, SHSTK
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-07 00:16:45 UTC
Thanks for the followup. Please feel free to file bugs with any CET issues. I've only played with it in enforcing very lightly (with the glibc tunable) and hit some issue with Java and didn't yet go back to it. H.J. still has a fork with the patches needed for OpenJDK, I think.
Comment 3 Maciej S. Szmigiero 2025-02-07 21:24:03 UTC
Thanks, I mostly try reporting these issues upstream where it makes sense.

In general, most of the CET issues seem to be caused either by code written in assembly 
or in Rust - for the later there might be a system-wide solution possible.

To add a bit more detail to this libgccjit.so.0 false alarm: I think it was indeed missing CET markings when build the first time with USE="cet" on a otherwise non-CET system (that's why my script flagged it), then re-building GCC fixed it.