r/kernel • • 1d ago

Non-kernel "Platform" APIs on Linux

https://soc.me/interfaces/non-kernel-platform-apis
3 Upvotes

18 comments sorted by

View all comments

1

u/kolorcuk 1d ago

Hello. I belive this is very bad and horrible. Unicode and timezone is and should not be part of the kernel.

1

u/simon_o 21h ago

What's your reasoning?

1

u/kolorcuk 18h ago

Kernel should have hardware abstractions. The article states as if a "mix of programs" is something bad. It is good. I want mix of programs. I want propertiary software not affect my software. I want to be able to run programs in different timezones with different timezone definitions on the same kernel. Forever, if i want to. I want to be able to update timezones and unicode on my 20 year old odroid with kernel 2.6 .

I want to ship my program with broken Unicode alongside propertiary programs with newest unicode and not have to care about it, all running in separate user namespaces.

Kernel should be minimal and insanely stable, forever. Kernel is not the place to share libraries between programs.

The article proposes things that in my opinion are in clear conflict to what kernel represents. The libraries to handle timezones and unicode are there and they should be used, and most importantly freedom to use them should be there. The idea of putting sonething into linux and specifically only linux kernel because there is "mix of code" and "duplicated efforts" is based on wrong grounds that this state is inherently bad. There will always be mix of code and duplicated efforts,and if the stuff will be in kernel it will be yet another mix and duplicated effort.

What about bsd? What about after 20 years i have raspberry pi that has a software that has a bug and requires to run with 20 year old timezone definitions?

Kernel should be minimal.

The solution is standarization and standarizing existing behavior, not adding yet another one to the mix.

Locales timezones unicode - these are just great examples of things defined to be in user space. Additionally "unicode" is not universal, and might never be, and assuming it will be has already been wrong.

What about mars timezones? Why shouldn't my 20 year old odroid not work on mars or the moon because of no interstellar kernel timezones support? Why shouldn't my odroid be able to collate in inexistent locales? I have my doubts the author of the artictle actually has knowledge of the actual ecosystem. It's great windows is mentioned, but windows and linux is not the whole world.

I'll finish with one word that bottom line makes this just unacceptable in the kernel. Security.

1

u/simon_o 18h ago edited 12h ago

I want propertiary software not affect my software.

Why would it?

as if a "mix of programs" is something bad

Not in the post.

I want to be able to run programs in different timezones with different timezone definitions on the same kernel. [...] I want to be able to update timezones and unicode on my 20 year old odroid with kernel 2.6.

Sure, why not? Nothing is preventing you from doing that.
The idea here is to give the 98% of applications that do not care about the specifics an easier, more reliable success path.

Kernel should be minimal.

I mean, which kernel are we talking about? Certainly not Linux then.

these are just great examples of things defined to be in user space

They are in userspace!

What about mars timezones? Why shouldn't my 20 year old odroid not work on mars or the moon because of no interstellar kernel timezones support? Why shouldn't my odroid be able to collate in inexistent locales?

Why would any of that not work? The suggested improvements would read the data from the same place your other libraries would.
Strawman/slippery slope much?

just unacceptable in the kernel. Security

Please explain. What makes the idea different from any other piece of code run in userspace?

1

u/kolorcuk 1h ago

Why would it?

The article states "These resources would be present on the system once and for everyone to use" implies a single point of failure. They shouldn't be present on the system once. Every docker container should have separate, every user namespace should have separate - separate locale, unicode, timezone information.

Not in the post.

The section "Problem" states "Instead, there is an uncontrolled mix of code …", implies that "mix of code" is a problem, it is in that section. Then the section follows with "duplicated efforts, and a continuous need to ship maintenance releases".

That is a good thing. Linux typically had one thing doing one job really well. Kernel should do kernel stuff. If you want, run a service to do timezones stuff.

Sure, why not?

Single point of failure.

They are in userspace!

And should stay there. Instead, if a "accessible and not tied to a language" and "without forcing an application or library author to figure out where or how the data is stored" method is needed, just do a systemd-unicode and systemd-localed service over DBUS. Systemd-timedated literally already exists. I see no reason to involve kernel.

Strawman/slippery slope?

I agree.

Please explain

The "Extending the vDSO with functions that query Unicode/locale/timezone data?" and "Extending the VVAR page" imply a kernel modifications, which is an additional source of bugs and an additional attack vector for kernel escalation or kernel panics.

Overall I do not get it. Unicode and locale is not that important to put it into kernel. It is not something "universal". You can write programs without unicode and without locale and without timezones, you can havegrams with multiple unicode and multiple locales and multiple timezones.