← Back to context

Comment by victorbjorklund

24 days ago

Explain? (Genuine question because I wanna know)

Basically, have an explicit distinction between data and code at the architectural level, to enforce "Write xor Execute" in hardware. In this way, you would prevent e.g. a buffer overflow letting an attacker injecting shellcode that gets executed later by somehow pointing at it. AFAIK the issue would still remain with some programming languages though.

  • don't we already have the NX bit?

    and it's not sufficient anyways. even with NX you could have the attacker control a function pointer you call. in any sufficiently complex program you'll have enough widgets to build anything you want just out of data.

    code and data are the same thing. whatever inputs your system receives is "code" that your application interprets, just like your application is the code that the CPU interprets. turtles all the way down.

  • But.. alter data that gets executed (interpeter?), I mean, how does this work even in theory? All data is potentially code?

    • To clarify what intrasight is talking about: A Harvard architecture CPU has two physically separate memory busses for code and data. This makes it possible to build a computer with a program memory that cannot be altered through the data bus. In practice, this isn't normally done -- even on Harvard architecture microcontrollers, the flash and RAM are connected to both busses because memory is expensive. And having inalterable program memory doesn't save you from stack-smashing attacks that alter a return address.

    • All data is potentially code only in a Von Neumann architecture, but not in a Harvard architecture, where there's a separation of data and code with different memory access to each.

      2 replies →

  • and we don't believe a sterilized virtual machine creates a similar situation?

    any respective machine doesn't require full Turing completeness?

    any ad-hoc machine allows for mutations and flexibility, which I'm sure is an added strength.

    2nd edit,

    Also, didn't we have a weaker model of this with segmented non-flat memory models on i386-