News for hackers. Stuff that matters.
Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Tuesday May 09, 2023 @09:12PM (#35882444)
There's easily thousands of such bugs hidden in the kernel.

Reminder the kernel has over a million LoCs, or megabytes of object code.

Perhaps we should start thinking about whether it is a good idea to run something this large in supervisor mode, with full privileges.

I wouldn't say it is sensible in a world where seL4 exists.

Re:Linux kernel use-after-free in Netfilter, local privilege... by 0cf8612b2e1e on Tuesday May 09, 2023 @09:36PM (#35882591)
Microkernel does seem the only sensible path forward. Even if the kernel is slowly rustified, going to be playing security whack-a-mole for a long time.
Re:Linux kernel use-after-free in Netfilter, local privilege... by anonymousiam on Tuesday May 09, 2023 @10:05PM (#35882773)
Back in the day when the micro-kernel/monolith flamewars were raging, the arguments for monolith were about improved performance and lower memory usage. I haven't seen much discussion on this topic for years, but at least those two arguments have not aged well.
Re:Linux kernel use-after-free in Netfilter, local privilege... by aflag on Wednesday May 10, 2023 @03:18AM (#35884642)
Why not? It isn't clear to me why monolithic kernel wouldn't still have better performance.
Re:Linux kernel use-after-free in Netfilter, local privilege... by pjmlp on Wednesday May 10, 2023 @04:08AM (#35884931)
It doesn't matter with layers hypervisors, virtualization, containers and sandboxes running on top.

All mitigations to achieve microkernel like capabilities.

Re:Linux kernel use-after-free in Netfilter, local privilege... by aflag on Wednesday May 10, 2023 @08:03AM (#35886147)
Hm, if you're making the underlying hardware slower, don't you want the kernel to be even faster though?
Re:Linux kernel use-after-free in Netfilter, local privilege... by pjmlp on Wednesday May 10, 2023 @10:14AM (#35887686)
Not when using hypervisor type 1.
Re:Linux kernel use-after-free in Netfilter, local privilege... by aflag on Wednesday May 10, 2023 @02:10PM (#35891120)
Why not? Hypervisor type 1 has less overhead, but it's still not quite the same as running directly on the box. I don't think micro kernels would replace those anyway. To be honest, I don't even really see the connection between running most of the kernel in user space and allowing concurrent systems to run in the same hardware.
Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Friday May 12, 2023 @07:55AM (#35914881)
seL4 with its VMM is a better hypervisor architecture than, say, Xen.

Xen is unfortunately large, and the full hypervisor runs privileged.

With seL4, VM exceptions are forwarded to VMM, which handles them.

From a security standpoint, a VM escape would only yield VMM privileges, which are no higher than that of the VM itself. This is much better than a compromise of Xen, which would compromise all VMs in the system.

Makatea[0] is an effort to build a Qubes-like system using seL4 and its virtualization support. It is currently funded by a NLNet grant.

0. https://trustworthy.systems/projects/TS/makatea

Re:Linux kernel use-after-free in Netfilter, local privilege... by pjmlp on Wednesday May 10, 2023 @04:12AM (#35884960)
Mostly because the cloud is based on microkernel like approach regardless of the kernel.

Hypervisors, userspace drivers, containers, language runtime sandboxes, bytecode deployments, driver and kernel sandboxes (safe kernel / driver guard),container only distributions,...

Re:Linux kernel use-after-free in Netfilter, local privilege... by mananaysiempre on Wednesday May 10, 2023 @07:17AM (#35885900)
Spectre and friends seem to have killed Liedtke’s fast synchronous IPC, unfortunately. Of course, there’s still asynchronous IPC, exokernels (perhaps the closest thing to today’s containers), and so on.
Re:Linux kernel use-after-free in Netfilter, local privilege... by galangalalgol on Tuesday May 09, 2023 @10:48PM (#35883068)
For rack servers you could probably get away with a number of microkernel os today. Desktop has clear options in that regard, but you are giving up op n source.
Re:Linux kernel use-after-free in Netfilter, local privilege... by CorbetL on Tuesday May 09, 2023 @11:29PM (#35883303)
Linux may eventually become a microkernel with most IPC done via io_uring, but it may take 20 years to reach this state.
Re:Linux kernel use-after-free in Netfilter, local privilege... by touisteur on Wednesday May 10, 2023 @02:39AM (#35884364)
Right now it seems microvms are the way. Build an extremely minimal tailored kernel+userland for network-facing components. If you don't have nf_tables built-in (and it's not loadable because not present) this vulnerability isn't a problem. I mean, right now to use it one would have to chain it with a RCE on your userland app (or on the kernel but just skip the nf_tables step then...). Then one would have to escape the VM, then if you're using firecracker or crosvm, you'll have to break seccomp. Still imaginable, but by then I guess the next kernel (or userland app) fix release is already available :-) and you're already rebooting your microvm.

If you can CI/CD in minutes a reduced kernel+app and reboot in 100ms your network-facing thing (be it nginx or haproxy) you might just take latest vanilla anyway...

Re:Linux kernel use-after-free in Netfilter, local privilege... by ttarr on Wednesday May 10, 2023 @10:54AM (#35888266)
Care to elaborate plz?

How would we go about GPUs, NCs, and many kinds of drivers?

Re:Linux kernel use-after-free in Netfilter, local privilege... by Gigachad on Tuesday May 09, 2023 @09:26PM (#35882530)
We really need to be moving faster on migrating Linux to a safer language which prevents these kinds of issues.
Re:Linux kernel use-after-free in Netfilter, local privilege... by unixhero on Tuesday May 09, 2023 @09:16PM (#35882472)
Well it is the kernel.
Re:Linux kernel use-after-free in Netfilter, local privilege... by phendrenad2 on Tuesday May 09, 2023 @10:06PM (#35882781)
Actually over 30 million LOC
Re:Linux kernel use-after-free in Netfilter, local privilege... by userbinator on Tuesday May 09, 2023 @10:07PM (#35882793)
Alternatively, perhaps we should start thinking about whether it is a good idea to have multiple users of different privilege sharing the same hardware.
Re:Linux kernel use-after-free in Netfilter, local privilege... by thfuran on Tuesday May 09, 2023 @10:48PM (#35883071)
What's the alternative, just running all code at ring 0?
Re:Linux kernel use-after-free in Netfilter, local privilege... by userbinator on Tuesday May 09, 2023 @11:51PM (#35883452)
IMHO rings 0 + 3 with protections against bugs, and not deliberate malice, is probably the sweet spot.
Re:Linux kernel use-after-free in Netfilter, local privilege... by Aerbil313 on Wednesday May 10, 2023 @03:18AM (#35884639)
Re:Linux kernel use-after-free in Netfilter, local privilege... by travis729 on Tuesday May 09, 2023 @11:35PM (#35883336)
I’ve been thinking this recently as well.
Re:Linux kernel use-after-free in Netfilter, local privilege... by gizmo686 on Tuesday May 09, 2023 @11:39PM (#35883366)
"User" in a modern Linux system is just a weird name for "security domain". Many programs run as their own user to limit their ability to attack the rest of the system if they get compromised; and limit the ability of a different compromised component from attacking them.

My desktop, on which I am the only person with an account, has 49 "users", of which 11 are actively running a process.

At work, every daemon we run has a dedicated user.

On android, every app runs as its own user.

Re:Linux kernel use-after-free in Netfilter, local privilege... by akvadrako on Tuesday May 09, 2023 @10:56PM (#35883127)
It won't make that big of a difference. If you exploit the networking layer you could intercept any local traffic, which will mostly be unencrypted, and communicate with outside attackers. You are probably owned by that point unless you treated localhost as untrusted.

It's like why it doesn't matter if you are running as root or not. The user account has access to whats important, like a database or keychain.

Re:Linux kernel use-after-free in Netfilter, local privilege... by saagarjha on Wednesday May 10, 2023 @12:02AM (#35883512)
Who's going to make seL4 perform comparably to Linux?
Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Wednesday May 10, 2023 @02:09AM (#35884206)
Why would we need to slow seL4 down?
Re:Linux kernel use-after-free in Netfilter, local privilege... by saagarjha on Wednesday May 10, 2023 @02:17AM (#35884241)
I'm not really in the mood for trolling.
Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Wednesday May 10, 2023 @04:07AM (#35884922)
The name-calling is uncalled for.

To elaborate, seL4 claims to be the fastest kernel around[0], a claim that remains unchallenged.

To put it into context, the difference in IPC speed is such that you'd need an order of magnitude more IPC for a multiserver system based on seL4 to actually be slower than Linux.

A multiserver design would imply increased IPC use, but not an order of magnitude.

0. https://trustworthy.systems/projects/seL4/

Re:Linux kernel use-after-free in Netfilter, local privilege... by bbarnett on Wednesday May 10, 2023 @06:07AM (#35885535)
The name-calling is uncalled for.

From an observer on the sidelines: there was no namecalling.

He said you trolled, not that you ate a troll. The distinction is important.

Even the best of us troll, sometimes. (Not claiming you did btw, just that there was no name calling.)

Re:Linux kernel use-after-free in Netfilter, local privilege... by camgunz on Wednesday May 10, 2023 @08:08AM (#35886185)
Sorry I'm pretty naive to this space. I didn't immediately see any performance info on that page save for this paper [0] which shows seL4 competitive with NetBSD, but far from Linux. Is there something else I should look at?

[0]: https://trustworthy.systems/publications/full_text/Elphinsto...

Re:Linux kernel use-after-free in Netfilter, local privilege... by arp242 on Wednesday May 10, 2023 @11:19AM (#35888647)
> To elaborate, seL4 claims to be the fastest kernel around[0], a claim that remains unchallenged.

Can I run Firefox or PostgreSQL on seL4? Or another real-world program of comparable complexity? And how does the performance of that compare to Linux or BSD?

That's really the only benchmark that matters; it's not hard to be fast if your kernel is simple, but simple is often also less useful. Terry Davis claimed TempleOS was faster than Linux, and in some ways he was right too. But TempleOS is also much more limited than Linux and, in the end, not all that useful – even Terry ran it inside a VM.

I've heard these sort of claims about seL4 before, and I've tried to look up some more detailed information about seL4 before, and I've never really found anything convincing on the topic beyond "TempleOS can do loads more context switched than Linux!" type stuff.

Re:Linux kernel use-after-free in Netfilter, local privilege... by saagarjha on Wednesday May 10, 2023 @07:04PM (#35894682)
No, it doesn’t. Here’s the full quote from their website:

> seL4 is the world’s fastest operating system kernel designed for security and safety

Linux is arguably not designed for security and safety but it blows seL4 out of the water when it comes to performance. There’s a reason it only gets used in contexts where security is critical; I would have expected that you would be aware of this considering you were the one who is promoting it.

Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Thursday May 11, 2023 @04:25PM (#35907904)
>but it blows seL4 out of the water when it comes to performance.

Citation needed.

And by that I mean actual benchmarks of Linux doing the few tasks seL4 does, such as IPC or context switching, faster than seL4.

Re:Linux kernel use-after-free in Netfilter, local privilege... by saagarjha on Thursday May 11, 2023 @05:38PM (#35908734)
No, you don’t get to define the benchmarks like that. People use an OS so they can run real-world programs on top of it, not spin it in a loop and see how fast it can do IPC. In a monolithic kernel there’s no need to switch contexts for many things; that’s the entire point of using one. I’m sure that seL4 has a perfectly fast implementation of those operations but that’s because it sits and does those all day as part of its basic functionality. Optimizing overhead doesn’t win you extra points when you’re comparing against an OS that doesn’t have it all.
Re:Linux kernel use-after-free in Netfilter, local privilege... by snvzz on Friday May 12, 2023 @10:21AM (#35916758)
seL4 is an order of magnitude faster at this "overhead" thing. We're talking nanoseconds vs microseconds difference.

The multiserver architecture does indeed imply an elevated use of IPC, but it does in no way outweigh the difference in IPC cost.

In this model, data sharing, and the implied locking, is minimized, which as a consequence helps SMP scaling.

Dragonfly, while not multiserver proper, took a different direction than Freebsd and Linux by optimizing IPC and not implementing fine-grained locks, and instead favoring concurrent lockless and lockfree servers.

As a consequence, Dragonfly scales much better than Freebsd, and in many benchmarks manages to outperform Linux.

This is despite the tiny development team, particularly so when considered relative to the amount of funding these two systems get.

I am sickened by the effort that's being wasted on a model that we know is bad and does not work. Linux will never be high assurance, secure or scale past a certain point.

Fortunately, no matter how long it'll take, the better technology will win; there's no "performance hack" that a bad system can pull to catch up with the better technology once it's there.

Just a matter of time.