Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent R_X86_64_REX_GOTPCRELX relocations for kernel modules referencing __stack_chk_guard #86195

Closed
justincady opened this issue Mar 21, 2024 · 4 comments

Comments

@justincady
Copy link
Contributor

Building FreeBSD kernel modules with a standard LLVM 17.0.6 toolchain and -fstack-protector results in them containing R_X86_64_REX_GOTPCRELX relocations (for __stack_chk_guard). These are unloadable, because this relocation type isn't handled by the FreeBSD kernel loader.

This was addressed internally within FreeBSD already via freebsd/freebsd-src@9a4d48a645a7a.

There has been discussion about upstreaming this into LLVM in D113443. It appears there was a consensus to submit once a comment was added. I'm filing this issue so we can get that patch submitted in some appropriate form.

cc @DimitryAndric @adalava

@justincady
Copy link
Contributor Author

Also, please see #60116, but note that the current !TM.getTargetTriple().isOSFreeBSD() condition in TargetLoweringBase::insertSSPDeclarations still overrules that fix. Thus, -fdirect-access-external-data is not a solution here.

@justincady
Copy link
Contributor Author

Duplicate of #50932

@justincady justincady marked this as a duplicate of #50932 Mar 25, 2024
@EugeneZelenko EugeneZelenko added duplicate Resolved as duplicate platform:freebsd and removed new issue labels Mar 25, 2024
@EugeneZelenko EugeneZelenko closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
@justincady
Copy link
Contributor Author

@EugeneZelenko Is there a better way to close a duplicate issue when the original is fixed? I just clicked "Close" after merging the fix for #50932 .

@EugeneZelenko
Copy link
Contributor

@justincady: Proper way for duplicates is "Close as not planned" which is accessible from context menu on the right of close button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants