logoalt Hacker News

roschdaltoday at 7:46 AM7 repliesview on HN

JIT compilation is unsecure.


Replies

asdfsa32today at 8:43 AM

You're entirely correct because JIT requires violating Write xor Execute security policy. This is the reason on iOS, it is limited to Apple shipped software.

https://en.wikipedia.org/wiki/W%5EX

show 2 replies
kllrnohjtoday at 12:52 PM

No, it isn't. JITs don't grant capabilities abilities an equivalent interpreter doesn't already have.

Allowing code execution allows code execution, that's it, that's the entirety of it.

show 1 reply
stevefan1999today at 10:49 AM

So what, are you willing to go away from von-neumann architecture where instructions are data and data are instructions, i.e. the instruction-data hominocity that underpins JIT compilation? Are you willing to go to a pseudo-Harvard architecture where the ability of JIT compiling is soft locked by other means like VM or strong code authentication or policy protection, which is what Apple is doing.

Fun fact: even Apple themselves have JIT. JavaScriptCore on iOS has JIT, it's just that the App Store policies forbid any application submissions with JIT or trying to mmap/mprotect an executable region. There used to be apps on TrollStore that runs JIT

sebzim4500today at 8:39 AM

Maybe, but surely there are users who are willing to trust all users of their db instance.

show 1 reply
dennis16384today at 8:00 AM

It is the core of ClickHouse for example, for many years. Is it secure enough in your opinion?

JackSlateurtoday at 9:30 AM

In rust, is jit equivalent to an "unsafe" block ?

show 2 replies
pjmlptoday at 9:37 AM

Machine code is insecure, we should all run interpreted code in a formally verified interpreter.

Alternatively, only allow for the execution of cryptographly signed static linked binaries, this naturally includes the interpreter above.

show 1 reply