News for hackers. Stuff that matters.
Re:OpenBSD: Immutable Userland Mappings by r12343a_19 on Sunday November 13, 2022 @10:46PM (#33590013)
I legit wonder if it's not time for OpenBSD to switch to Java.

I mean, there's so much work to keep C safe and make sure memory is managed well, etc.

What the project needs is a virtual machine! Clearly they don't care about performance when security is on the line (they did disable multithreading, no?). A good virtual machine will be a small performance loss compared to dealing with this stuff... forever.

Of course, you still have to deal with user land binaries.

Re:OpenBSD: Immutable Userland Mappings by AaronFriel on Sunday November 13, 2022 @11:29PM (#33590202)
Garbage collection and just-in-time compilation in the kernel? I'm thinking you must be joking.

This mailing list article is about providing new or modified behavior in the kernel to guarantee behaviors - and security - to userland programs in any language.

Re: Disabling multithreading, I think you might be referring to disabling symmetric multiprocessing (SMP), also known as hyperthreading.

Re:OpenBSD: Immutable Userland Mappings by insanitybit on Sunday November 13, 2022 @11:48PM (#33590281)
Linux's eBPF is JIT compiled and has its memory managed fwiw. There are lots of virtual machines in kernels, they're an excellent fit.
Re:OpenBSD: Immutable Userland Mappings by AaronFriel on Monday November 14, 2022 @12:23AM (#33590433)
Sure, but this seems like a non-sequitur. eBPF has its memory managed in a very different sense than a garbage collector, eBPF programs cannot loop, and so on.

Java's virtual machine is so substantially different it's hard to know where to begin.

Re:OpenBSD: Immutable Userland Mappings by pjmlp on Monday November 14, 2022 @02:47AM (#33591206)
You can start here, for bare metal deployments,

https://www.ptc.com/en/products/developer-tools/perc

Re:OpenBSD: Immutable Userland Mappings by AaronFriel on Monday November 14, 2022 @12:57PM (#33598069)
I don't understand why this non-sequitur keeps going! There seems to be a lot of point-missing here.

OpenBSD is a kernel and a general purpose operating system. It runs arbitrary userland software.

Rewriting the kernel in Java will not make C user code safer, and the cost to convert OpenBSD is so nontrivial as to make it an absurd suggestion. I mean, really truly absurd. As in, "am I even talking to real people who work with software?" absurd. If you think it's a good idea to rewrite a posix-compatible OS kernel in Java, by all means, go do so and make a patch against OpenBSD. It's a monumental undertaking, and I'm sure it'll be impressive!

On the other hand, rewriting userland software in Java (from C) will definitely make it safer, but users can already do this and are choosing not to. The goal of this change is to make it easier to write safer C.

Re:OpenBSD: Immutable Userland Mappings by pjmlp on Monday November 14, 2022 @01:25PM (#33598547)
A bare metal language runtime is a kernel....

I am fully aware UNIX clones will never use anything beyond C for most part, although there are some famous UNIXes like Apollo that did indeed trail another path.

Re:OpenBSD: Immutable Userland Mappings by AaronFriel on Monday November 14, 2022 @07:34PM (#33603553)
The context of this thread is adding syscall to the kernel to allow C userland programs to be safer.

Even if the kernel were written in Java - which is, again, absurd to ask of the OpenBSD developers - it would still be a viable syscall to add for user mode programs written in memory unsafe languages.

Re:OpenBSD: Immutable Userland Mappings by pjmlp on Tuesday November 15, 2022 @01:34AM (#33605984)
Only way to make C "safer", is to follow Solaris footsteps, hardware memory tagging.
Re:OpenBSD: Immutable Userland Mappings by senkora on Monday November 14, 2022 @12:04AM (#33590351)
You mean simultaneous multithreading (SMT), aka hyperthreading.

Symmetric multiprocessing (SMP) is when all processors have uniform distance from all memory, as opposed to non-uniform memory access (NUMA).

Re:OpenBSD: Immutable Userland Mappings by AaronFriel on Monday November 14, 2022 @12:17AM (#33590406)
D'oh! You're absolutely right. Fixed my comment, thank you!
Re:OpenBSD: Immutable Userland Mappings by pjmlp on Monday November 14, 2022 @02:45AM (#33591200)
Nope,

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

Or, for another example,

https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...

It is only incompatible with UNIX school of thought.

Re:OpenBSD: Immutable Userland Mappings by MuffinFlavored on Sunday November 13, 2022 @11:32PM (#33590215)
Why not Rust?
Re:OpenBSD: Immutable Userland Mappings by kavulox on Monday November 14, 2022 @12:11AM (#33590372)
How would rust do anything to help?
Re:OpenBSD: Immutable Userland Mappings by insanitybit on Sunday November 13, 2022 @11:47PM (#33590279)
Even if we had memory safety I think immutable userland mappings would be a valid and interesting technique to implement.
Re:OpenBSD: Immutable Userland Mappings by hurraopenbsd on Monday November 14, 2022 @12:44AM (#33590545)
OpenBSD still has not switched to advanced technologies like file system journaling, so Java is probably a stretch.