News for hackers. Stuff that matters.
Re:-fbounds-safety: Enforcing bounds safety for C by musicale on Wednesday February 18, 2026 @01:18AM (#47057820)
I want an OS distro where all C code is compiled this way.

OpenBSD maybe? or a fork of CheriBSD?

macOS clang has supported -fbounds-safety for a while, but I"m not sure how extensively it is used.

Re:-fbounds-safety: Enforcing bounds safety for C by 1over137 on Thursday February 19, 2026 @09:05AM (#47073848)
>I want an OS distro where all C code is compiled this way.

You first have to modify "all C code". It's not just a set and forget compiler flag.

Re:-fbounds-safety: Enforcing bounds safety for C by musicale on Friday February 20, 2026 @11:37PM (#47097545)
Indeed. I still want it.
Re:-fbounds-safety: Enforcing bounds safety for C by wyldfire on Thursday February 19, 2026 @09:06AM (#47073858)
You need to annotate your program with indications of what variable tracks the size of the allocation. So, sure, but first work on the packages in the distro.

Note that corresponding checks for C++ library containers can be enabled without modifying the source. Google measured some very small overhead (< 0.5% IIRC) so they turned it on in production. But I'd expect an OS distro to be mostly C.

[1] https://libcxx.llvm.org/Hardening.html

Re:-fbounds-safety: Enforcing bounds safety for C by bombcar on Thursday February 19, 2026 @09:08AM (#47073876)
Get gentoo, add this to CFLAGS and start fixing everything that breaks. Become a hero.
Re:-fbounds-safety: Enforcing bounds safety for C by pezgrande on Thursday February 19, 2026 @09:17AM (#47073974)
does any distro uses clang? I thought all linux kernels were compiled using gcc.
Re:-fbounds-safety: Enforcing bounds safety for C by zmodem on Thursday February 19, 2026 @10:01AM (#47074520)
Not a Linux distro, but FreeBSD uses Clang.

And Android uses Clang for its Linux kernel.

-fbounds-safety is not yet available in upstream Clang though:

> NOTE: This is a design document and the feature is not available for users yet.

Re:-fbounds-safety: Enforcing bounds safety for C by honktime on Thursday February 19, 2026 @10:44AM (#47075031)
Chimera does, it also has a FreeBSD userland AFAIU.

https://chimera-linux.org/

Re:-fbounds-safety: Enforcing bounds safety for C by pezgrande on Friday February 20, 2026 @04:30AM (#47085665)
hm this one is interesting. Thanks for sharing!
Re:-fbounds-safety: Enforcing bounds safety for C by yjftsjthsd-h on Thursday February 19, 2026 @01:17PM (#47077024)
https://www.kernel.org/doc/html/latest/kbuild/llvm.html

> The Linux kernel has always traditionally been compiled with GNU toolchains such as GCC and binutils. Ongoing work has allowed for Clang and LLVM utilities to be used as viable substitutes. Distributions such as Android, ChromeOS, OpenMandriva, and Chimera Linux use Clang built kernels. Google’s and Meta’s datacenter fleets also run kernels built with Clang.

Re:-fbounds-safety: Enforcing bounds safety for C by pjmlp on Thursday February 19, 2026 @09:34AM (#47074172)
It is called Solaris, and has this enabled since 2015 on SPARC.

https://docs.oracle.com/en/operating-systems/solaris/oracle-...

Re:-fbounds-safety: Enforcing bounds safety for C by salawat on Thursday February 19, 2026 @01:16PM (#47077013)
Might as well not even talk about anything with the Oracular kiss of death.
Re:-fbounds-safety: Enforcing bounds safety for C by rbanffy on Thursday February 19, 2026 @01:54PM (#47077560)
Isn’t Illumos and OpenIndiana doing the same?

I still remember someone at Sun commented they treated warnings as errors. This is how software should be developed.

Re:-fbounds-safety: Enforcing bounds safety for C by kbolino on Thursday February 19, 2026 @02:19PM (#47077873)
The feature is only on SPARC, not x86. Oracle killed in-house SPARC development in 2017, and they abandoned OpenSPARC after they acquired Sun, so it's effectively a dead architecture. The software won't work without the hardware to run it on.
Re:-fbounds-safety: Enforcing bounds safety for C by pjmlp on Thursday February 19, 2026 @02:22PM (#47077919)
Fujsitsu also does SPARC, and contrary to HP-UX, people still do buy Solaris.

EDIT:

https://www.oracle.com/servers/sparc/

https://www.fujitsu.com/global/products/computing/servers/un...

Finally, it is up to Intel and AMD to come up with hardware memory tagging, so far they have messed up all attempts, with MPX being the last short lived one.

Re:-fbounds-safety: Enforcing bounds safety for C by kbolino on Thursday February 19, 2026 @02:32PM (#47078051)
It's good info, and I wouldn't rush a migration off of SPARC systems if I was already using them, but slow death is still death. It was already worrying that workstations were killed off by Sun before the Oracle acquisition; it seems quite clear that no one has been serious about spreading adoption of the architecture for more than two decades now.
Re:-fbounds-safety: Enforcing bounds safety for C by rbanffy on Friday February 20, 2026 @09:10AM (#47088266)
Even Fujitsu has been moving away from SPARC. What was the last SPARC Fujitsu designed?
Re:-fbounds-safety: Enforcing bounds safety for C by pjmlp on Friday February 20, 2026 @03:06PM (#47093184)
What matters is that they are still selling them.
Re:-fbounds-safety: Enforcing bounds safety for C by rbanffy on Sunday February 22, 2026 @06:17AM (#47110108)
Kind of. Atos still sell GCOS/GECOS mainframes, but they are Xeon boxes running emulators. Same with Unisys and MCP (which was written in an ALGOL and had bounds checked IIRC).
Re:-fbounds-safety: Enforcing bounds safety for C by pjmlp on Thursday February 19, 2026 @02:18PM (#47077870)
Not everyone suffers from Oracle phobia.

Some of us actually do read licenses before using products.

Also the FAANG are hardly any better only because they spew cool marketing stuff like do no evil.

Re:-fbounds-safety: Enforcing bounds safety for C by rbanffy on Sunday February 22, 2026 @06:20AM (#47110119)
FAANG won’t send auditors to check whether your are in compliance with what license you paid for. Per core/socket licensing is one of the reasons POWER can do SMT/8.
Re:-fbounds-safety: Enforcing bounds safety for C by prussian on Thursday February 19, 2026 @09:34AM (#47074180)
Fedora and its kernels are built with GCC's _FORTIFY_SOURCE and I've seen modules crash for out of bounds reads.
Re:-fbounds-safety: Enforcing bounds safety for C by dezgeg on Thursday February 19, 2026 @10:05AM (#47074559)
_FORTIFY_SOURCE is way smaller in scope (as in, closes less vulnerabilities) than -fbounds-safety.
Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @10:19AM (#47074727)
What are you hoping it will achieve?
Re:-fbounds-safety: Enforcing bounds safety for C by irishcoffee on Thursday February 19, 2026 @10:25AM (#47074808)
The internet went down because cloudflare used a bad config... a config parsed by a rust app.

One of these days the witch hunt against C will go away.

Re:-fbounds-safety: Enforcing bounds safety for C by hypeatei on Thursday February 19, 2026 @10:56AM (#47075149)
The internet didn't go down and you're mischaracterizing it as a parsing issue when the list would've exceeded memory allocation limits. They didn't hardcode a fallback config for that case. What memory safety promise did Rust fail there exactly?
Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @10:58AM (#47075175)
I think the point is memory bugs are only one (small) subset of bugs.
Re:-fbounds-safety: Enforcing bounds safety for C by Abstract_Typist on Thursday February 19, 2026 @02:37PM (#47078113)
The conventional wisdom is ~70% of serious security bugs are memory safety issues.

https://www.cisa.gov/sites/default/files/2023-12/CSAC_TAC_Re...

Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @04:17PM (#47079532)
Security bugs - and not bad security processes, are a small subset of bugs.
Re:-fbounds-safety: Enforcing bounds safety for C by random_mutex on Thursday February 19, 2026 @10:37AM (#47074959)
A panic in Rust is easier to diagnose and fix than some error or grabage data that was caused by an out of bounds access in some random place in the call stack
Re:-fbounds-safety: Enforcing bounds safety for C by wat10000 on Thursday February 19, 2026 @11:23AM (#47075443)
A service going down is a million times better than being exploited by an attacker. If this is a witch hunt then C is an actual witch.
Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @04:19PM (#47079555)
Why can it be exploited? I’ve configured my OS so my process is isolated to the resources it needs.
Re:-fbounds-safety: Enforcing bounds safety for C by wat10000 on Thursday February 19, 2026 @07:52PM (#47082194)
What language is your OS written in?
Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @09:42PM (#47082993)
It’s written in C I’m glad you asked. Do you have any exploits in the Linux process encapsulation to share?

Surely your not suggesting that the Rust compiler never produces exploitable code?

Re:-fbounds-safety: Enforcing bounds safety for C by wat10000 on Thursday February 19, 2026 @09:52PM (#47083068)
I probably don’t have such an exploit, since you’re probably running something up to date. There have been many in the past. I doubt the last one to be fixed is the last one to exist.

If your attitude is that getting exploited doesn’t matter because your software is unprivileged, you need some part of your stack to be unexploitable. That’s a tall order if everything is C.

You can get exploitable code out of any compiler. But you’re far more likely to get it from real-world C than real-world Rust.

Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Thursday February 19, 2026 @10:08PM (#47083172)
> you need some part of your stack to be unexploitable.

Kernel level process isolation is extremely robust.

> If your attitude is that getting exploited doesn’t matter because your software is unprivileged

It’s not that exploits doesn’t matter. It’s that process architecture is a stronger form of guarantee than anything provided by a language runtime.

I agree that the place where rust is most beneficial is for programs that must be privileged and that are likely to face attack - such as a web server.

But the idea that you can’t securely use a C program in your stack or that rust magically makes process isolation irrelevant is incorrect.

Re:-fbounds-safety: Enforcing bounds safety for C by wat10000 on Thursday February 19, 2026 @10:27PM (#47083290)
How can process architecture be a stronger guarantee than anything provided by a language runtime when it is enforced by software written in a language?

You have a process receiving untrusted, potentially malicious input from the outside. If there’s an exploit then an attacker can potentially take control of the process. Your process is isolated, that’s good. But it can still communicate with other parts of your system. It can make syscalls. Now you’re in the same situation where you have a program receiving untrusted, potentially malicious input from the outside, but now “the outside” is your subverted process, and “a program” is the kernel. The same factors that make your program difficult to secure from exploits if it’s written in C also apply to the kernel.

I’m not sure where those ideas as the end of your comment came from. I certainly didn’t say them.

Re:-fbounds-safety: Enforcing bounds safety for C by groundzeros2015 on Sunday February 22, 2026 @10:41PM (#47117818)
> How can process architecture be a stronger guarantee than anything provided by a language runtime when it is enforced by software written in a language?

Please learn more about this topic. You don't understand OS security models.

Re:-fbounds-safety: Enforcing bounds safety for C by kgeist on Thursday February 19, 2026 @10:53AM (#47075113)
Maybe this:

https://fil-c.org/pizlix

>Pizlix is LFS (Linux From Scratch) 12.2 with some added components, where userland is compiled with Fil-C. This means you get the most memory safe Linux-like OS currently available.

The author, @pizlonator, is active on HN.

Re:-fbounds-safety: Enforcing bounds safety for C by hsaliak on Thursday February 19, 2026 @11:44AM (#47075760)
https://github.com/hsaliak/filc-bazel-template i created this recently to make it super easy to get started with fil-c projects. If you find it daunting to get started with the setup in the core distribution and want a 3-4 step approach to building a fil-c enabled binary, then try this.
Re:-fbounds-safety: Enforcing bounds safety for C by functionmouse on Thursday February 19, 2026 @10:59AM (#47075180)
hot dang that's neato. shame about the name, though.
Re:-fbounds-safety: Enforcing bounds safety for C by musicale on Friday February 20, 2026 @11:11PM (#47097417)
I'm aware of Pizlix - it's a good project/idea that needs to go mainstream; as you mention, memory safety is currently limited to userland (still a huge improvement over traditional unsafe userland.)

Note also that it uses fil-c rather than clang with -fbounds-safety. I believe fil-c requires fewer code changes than -fbounds-safety.