3 ms·
Without bounds checks: game crashes, core dump. With bounds checks: game crashes, meaningless error message given to the user. What am I missing?
by krona 4y ago
Without bounds checks: game crashes, core dump.
With bounds checks: game crashes, meaningless error message given to the user.
What am I missing?
- nordsieck 4y ago> What am I missing? Sometimes without bounds checking you get an exploit instead of a crash.
- gaganyaan 4y agoThe meaningless error message can be entered into Google and the user can find a thread about how to fix their specific problem instead of wading through endless threads of similar-but-unrelated problems.
- ekimekim 4y agoWith bounds checks: game crashes, meaningless error message given to the user. Without bounds checks: I join a multiplayer lobby, and the next thing I know my computer is part of a botnet. This isn't an imaginary fear, it has happened many times. Some examples from a brief search: https://gridinsoft.com/blogs/rce-vulnerability-in-gta-online/ https://gridinsoft.com/blogs/rce-vulnerability-in-gta-online... https://www.polygon.com/22898895/dark-souls-pvp-exploit-multiplayer-servers-remote-code-execution https://www.polygon.com/22898895/dark-souls-pvp-exploit-mult... https://security.gerhardt.link/RCE-in-Factorio/ https://security.gerhardt.link/RCE-in-Factorio/ I am not claiming all of these would've been prevented by bounds checking arrays, or even memory safety in general. The point is that security is not optional just because it's a game.
- dxhdr 4y agoNow suppose your game runs in a WASM sandbox and re-run those scenarios. What do you gain from bounds checks? I'm not suggesting that shipping without bounds checks is wise or leads to a better product. However I do think with /some games/ security is basically not a concern.
- Arnavion 4y agoHeartbleed still happens inside a sandbox, because it's the sandboxed memory that leaks. For multiplayer games specifically, that can be a client auth key that can be used to impersonate you.
- titzer 4y ago> Without bounds checks: game crashes, core dump. I think it's more like (assuming it does actually go out of bounds at some point): 30% chance of core dump right away 20% chance of core dump at some point after errant write 40% chance it never crashes in testing 5% chance it doesn't crash the first year after shipping 5% chance it never crashes With an explicit bounds check, all of these scenarios result in a crash at the exact location where the program first violated safety[1]. The developer gets a source-level crash and doesn't spend the first 20 minutes just trying to figure out what the crash dump even means. [1] Hopefully with a complete stacktrace, maybe even the index and length values! It's time we recognized that all our tooling should be designed to help us programmers who do have bugs in our program. Like, this crashing part is the normal part that all the tools should help deal with.
- adgjlsfhk1 4y agothe bounds check can sometimes catch the error before it corrupts your save.