News for hackers. Stuff that matters.
Re:Simple Linux kernel memory corruption bug can lead to com... by pjmlp on Wednesday October 20, 2021 @07:52AM (#28929576)
Same applies when using C++ with bounds checking enabled, but the FUD regarding bounds checking is deep.
Re:Simple Linux kernel memory corruption bug can lead to com... by tialaramex on Wednesday October 20, 2021 @10:07AM (#28930815)
What happens about mutation in the C++ case though? Maybe I should just try it in Godbolt instead of bothering people on HN.
Re:Simple Linux kernel memory corruption bug can lead to com... by pjmlp on Wednesday October 20, 2021 @10:15AM (#28930903)
What mutation?

Naturally this only kind of works when everyone on the team goes safety first.

Doing some C style coding will just bork it, similarly to any unsafe block or FFI call in other better suited languages.

But in the subject of making juice with lemons, is way better than plain C.

Re:Simple Linux kernel memory corruption bug can lead to com... by tialaramex on Wednesday October 20, 2021 @01:16PM (#28933247)
Right, so long as there isn't mutation, we're golden, which is why the machine code is the same.

This is, after all, why Godbolt was first invented as I suspect you know (Matt Godbolt wondered if C++ iterators really do produce the same machine code as a hand-rolled C-style for loop, and rather than just trust an expert he built the earliest Compiler Explorer to show that yes, with real C++ code you get the same machine code, any time spent hand-rolling such loops is time wasted)

Re:Simple Linux kernel memory corruption bug can lead to com... by pjmlp on Wednesday October 20, 2021 @03:51PM (#28935408)
Yeah, but since there are domains where C++ is unavoidable, this is the best we can do.

By the way, this should be a nice update about the state of affairs on Android (I am yet to watch it).

"Improving Memory Safety in Android 12 Using MTE"

https://devsummit.arm.com/en/sessions/57

Re:Simple Linux kernel memory corruption bug can lead to com... by tialaramex on Wednesday October 20, 2021 @07:49PM (#28938414)
I don't understand what you mean by "domains where C++ is unavoidable" in this context. C++ is a choice, presumably usually a reasonable choice, but a choice, so if they wanted to people could avoid it.

Memory tagging (which is what MTE is about) reminds me of ASLR and password entropy requirements. They're slightly raising the bar which is not something I have much time for. I prefer to put the effort in to solve problems permanently so I can worry about something else instead. Whether that's a practical opportunity here is unclear though, and I think Rust is a big part of finding out.