Binder (Android's core IPC) Rust rewrite posted to LKML (lore.kernel.org)
from Tobu@lemmy.ml to linux@lemmy.ml on 01 Nov 2023 23:39
https://lemmy.ml/post/7362820

Performance is basically the same (in microbenchmarks), they went as far as preserving the use of red black trees for an apples to apples comparison, but it’s going to improve security as binder runs inside every process.

That means binder is going to join Asahi graphics, the Android Bluetooth stack, and puzzlefs in the serious drivers written in Rust club.

#linux

threaded - newest

pr06lefs@lemmy.ml on 02 Nov 2023 00:47 next collapse

IPC standing for Inter Process Communication in this instance.

pastermil@sh.itjust.works on 02 Nov 2023 03:36 collapse

What else would it stand for?

pr06lefs@lemmy.ml on 02 Nov 2023 10:35 next collapse

I find it annoying when an article contains ATANE.

Atemu@lemmy.ml on 02 Nov 2023 17:41 collapse

Clear case of DOTA.

LaLiLuLuCo@lemmy.ca on 02 Nov 2023 18:54 next collapse

Interastral Peace Corp

Decker108@lemmy.ml on 02 Nov 2023 21:35 collapse

What about Intraastral Peace Corps?

conciselyverbose@kbin.social on 02 Nov 2023 19:07 next collapse

It's instructions per clock/cycle in a hardware context, because you can't use clock speeds to compare performance between processors.

pastermil@sh.itjust.works on 03 Nov 2023 01:56 collapse

That is true…

[deleted] on 03 Nov 2023 05:02 next collapse

.

ElNuevo@lemmy.lemist.de on 02 Nov 2023 05:29 collapse

Instructions per cycle

Was what I first read anyways

Quackdoc@lemmy.world on 02 Nov 2023 01:45 next collapse

This could be interesting, a bit worried how this will effect existing binder in distros and DKMS modules since waydroid relies on these

Atemu@lemmy.ml on 02 Nov 2023 09:09 next collapse

The C binder driver has been in the mainline kernel for one or two years at this point.

Quackdoc@lemmy.world on 03 Nov 2023 01:35 collapse

just because its in mainline, doesnt mean distros build them though we are now seeing more and more distros use them, binder/fs being enabled is not a given

Tobu@lemmy.ml on 02 Nov 2023 12:38 collapse

Distros will work a bit at shipping the right toolchain the first time they ship a rust-written module, but otherwise, it can’t break userspace. I guess they’ll start by merging the close reimplementation to make regressions easy to track.

Spectacle8011@lemmy.comfysnug.space on 02 Nov 2023 09:22 collapse

This is the kind of high-quality technical discussion I don’t understand a word of that rarely surfaced on reddit.

stardreamer@lemmy.blahaj.zone on 03 Nov 2023 05:11 collapse

Having one program (process) talk to another is dangerous. Think of a stranger trying to come over to me and deliver a message. There’s no way I can guarantee that he isn’t planning to stab me as soon as he sees me.

That’s why we have special mechanisms for programs talking to other programs. Instead of having the stranger deliver the message directly to me, our mutual friend Bob (IPC Library, binder in this case) acts as an intermediary. This way at least I can’t be “directly” stabbed.

What’s preventing the stranger from convincing Bob to stab me? Not much (except for Bob’s own ethics/programming)

To work around this, we have designed programming languages (rust) that don’t work if there’s a possibility of it being corrupted (I would add “at least superficially”, but that’s not the main topic here). Bob was trained by the CIA in anti-brainwashing techniques. It’s really hard to convince Bob to stab me. That’s why it’s such a big deal. We now have a way of delivering messages between two programs that is much safer than before.

The only problem is that the CIA anti-brainwashing techniques (rust) tend to make people slow. So we deliver messages less efficiently than before. Good news is in this case we managed to make Bob almost as fast as before, so we don’t lose our own much while gaining additional security. The people who checked on Bob even made sure to have Bob do the exact same thing as before when delivering messages (using RB Trees), hence this evidence is most likely credible.

Spectacle8011@lemmy.comfysnug.space on 03 Nov 2023 07:17 collapse

That’s a great explanation! Thank you, I get it now. I always did wonder what exactly IPC was about. Yay for Rust in the kernel.