3 ms·
On a von Neumann architecture, there is no actual distinction between code and data. Every CPU architecture in widespread use is a von Neumann architecture (GPU
by jcranmer 9y ago
On a von Neumann architecture, there is no actual distinction between code and data. Every CPU architecture in widespread use is a von Neumann architecture (GPUs, it should be noted generally aren't von Neumann). What this means is that loading data from unsecure, untrusted sources is potentially the same as executing code. In practice, this is actually very often the case--a buffer overflow trivially turns data into code.
With that in mind, what realistically is possible to do, over than to declare that everything can only be read as plain text (and hope there's no exploitable bugs in font rendering of system fonts)?
- quotemstr 9y agoWhat is "code" anyway except instructions? The Harvard-Von-Neumann distinction is really a continuum. Even today's computers draw important distinctions between data and code: for example, we have separate data and instruction caches, and Linux has special caching behavior for PROT_EXEC pages. (The latter is an annoyance, BTW: there's no reason to treat Java bytecode, say, differently from PROT_EXEC pages. Executable protection should have nothing to do with active or inactive list membership.)
- madez 9y agoThere is a huge difference from the security perspective between rendering a static HTML site and executing JavaScript. That theoretically they might be close has no practical meaning, and insisting on it may paralyse us into doing nothing. Securing font rendering or HTML rendering is achievable. I suggest replacing the C code by code written in a language with stronger static verification, like Rust. Also, JavaScript and WebAssembly (the latest starting with this talk) are actively used for unauthorized access to computers. It's not like I'm pointing out theoretical attack possibilities. This makes the matter more urgent.
- jcranmer 9y agoWhat about JS is so odious? That it's Turing complete? Well, so is XSLT, yet you don't seem uptight about people implementing it. JS does provide some very valid use-cases, and two of them that come to mind are interactivity and displaying static data that has no neat representation in HTML (e.g., Mathjax and d3.js for charting). My point is that JS is far from the only massive, complex, potentially security-laden hole in a modern web browser. Audio/video codecs are notoriously complex, and font rendering also has this nasty habit of causing kernel crashes on Windows. These have been used for active exploits. The way you achieve security is you have to look at the risks and work out ways to mitigate them. There are ways to be quite secure even allowing JS execution.
- pygy_ 9y agoThe addition of the NX bit to CPUs blurs the line between Von Neuman and Harvard architectures. Giving an attacker a JIT makes it easier for them to lay out memory with the NX bit set to zero (executable memory) that they can later jump into. Return-oriented programming can still be used to hijack a program that whose executable parts are locked down at runtime, having a JIT just makes things easier.
- y_u_no_rust 9y ago> There are ways to be quite secure even allowing JS execution. ;)
- TheAceOfHearts 9y agoIf I recall correctly, WASM separates code and data, along with a bunch of other security features.