News for hackers. Stuff that matters.
Re:Towards fearless SIMD, 7 years later by jenadine on Monday March 31, 2025 @01:10PM (#43537295)
Your conception of UB is flawed.

This has nothing to do with memory protection. If a process has the ability to do something, then it may do so. It wouldn't be because GCC and clang choose to melt your computer, it is because your program has a bug, and the consequences of that bug can be anything, including jumping into random executable code that happens to ruin the computer.

Re:Towards fearless SIMD, 7 years later by grandempire on Monday March 31, 2025 @02:58PM (#43538467)
What are you responding to here?

> If a process has the ability to do something, then it may do so

You agree with me. Once again, on an embedded device writing over a buffer may do absolutely anything. Thanks to memory protection, what a process can do is more limited. The C spec is written for both cases.

No gcc and clang will not insert code to start rm’ing files when you overflow a signed integer.

Re:Towards fearless SIMD, 7 years later by jenadine on Tuesday April 01, 2025 @01:48AM (#43543250)
> gcc and clang will not insert code to start rm’ing files when you overflow a signed integer.

It could. If it detect that a code path cannot be taken without causing overflow, it will assume this code path cannot be taken and will optimise it by removing it. No need even to return from the function. If you reach this code anyway, it can run whatever functions is on the binary after it. If you're unlucky that's a function to remove temporary files which would be ran with bogus arguments.

Re:Towards fearless SIMD, 7 years later by eru on Tuesday April 01, 2025 @02:48AM (#43543589)
If you are unlucky, it's going to execute whatever user data a malicious attacker added by carefully crafted input.

(Yes, these days that's harder, but you can still do a more complicated version of the same attacks. See return oriented programming.)