News for hackers. Stuff that matters.
Re:Updating the Go Memory Model by gpderetta on Monday July 12, 2021 @02:31PM (#27813467)
No it is not better. Java will preserve the integrity of the runtime. Still memory safety issues in go due to races are probably very hard to exploit so it might not make a huge difference in practice.
Re:Updating the Go Memory Model by ngrilly on Monday July 12, 2021 @03:31PM (#27814037)
Yes, the JVM will keep executing the program, but I'm still not convinced this is strictly better than segfaulting if a thread is stuck in an infinite loop using CPU for nothing, and another is leaking memory.
Re:Updating the Go Memory Model by jjnoakes on Monday July 12, 2021 @08:08PM (#27816485)
The problem is, UB is not guaranteed to segfault. A guaranteed segfault when a bug is hit would be great - but randomly getting one of (segfault, silent memory corruption, invalid instructions, ...) is not great, and most people would consider that to be much different than what Java gives you.
Re:Updating the Go Memory Model by gpderetta on Monday July 12, 2021 @03:37PM (#27814112)
It is better than invoking random code because the runtime mistakes some data for a vtable pointer.
Re:Updating the Go Memory Model by ngrilly on Monday July 12, 2021 @03:59PM (#27814374)
I agree that a data race on an interface value in Go, is worse than an infinite loop or a memory leak, because it can lead to calling the wrong method on a value, which is hard to debug.
Re:Updating the Go Memory Model by yc12340 on Monday July 12, 2021 @11:47PM (#27817459)
...and easy to exploit
Re:Updating the Go Memory Model by ngrilly on Tuesday July 13, 2021 @11:42AM (#27822343)
Not easy, but definitely possible:

https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...

> We have to admit that exploiting this requires a fairly specific situation in which there is a data race we could trigger and some structs with function pointers around.

Re:Updating the Go Memory Model by gpderetta on Wednesday July 14, 2021 @05:27AM (#27831176)
Nice.

I would note that Java is designed to run untrusted code, so fat pointers would be unacceptable as the attacker could easily craft the code required to trigger the race. Go does not claim to provide sandboxing of untrusted programs.