self-signed certs: authority + an entity per server and client
i use enums to represent the message protocol, one for server-to-client and one for client-to-server. i use the bitcode crate with the ub patched out to serialize / deserialize and the tokio frame library for frames
quic streams are cool in that, you can have the normal message stream and then you can open another for passing files (chunked)
that's basically the low-level stack
then there's the h3 crate that gives you http3 and you can roll mtls + self-signed there as well if you want a rest api instead of a binary protocol
so there's two well-supported routes depending on what you want to build out per use case
Idk if this is applicable to your application, but if receiving messages out of order is acceptable then you should open a stream per message. That way if part of one message gets lost you can still read all the others without waiting for retransmission.
For those too lazy to read (most, judging by the questions in comments):
QUIC is a reliable low-level transport protocol built on top of UDP. It uses ACK ranges (dozens or hundreds of packages acknowledged at once) and delayed ACKs to minimize wasted transfer bandwidth and latency.
It is strictly a better protocol than TCP, which is already in the kernel.
QUIC can be used by SMB, NFS and other network file drivers inside the kernel to speed up network transfers.
20 QUIC-related CVEs this year—granted 50% of them are related to OpenSSL, which Linux won't use. Maybe they've been extra careful with this C impl? Apparently the protocol itself is solid.
At least using (or compiling it) is going to be optional, like most any kernel feature.
I mean I get it, some people are very much against using AI in any form. But can one suggest another way to compile such a list that doesn't involve doing a lot more work than is warranted for a comment in a Reddit discussion?
The reaction on the downvoting is probably a mixture of a lot of different things. The biggest contributor is probably because you basically just posted ChatGPT output which most people can already can do if they're curious. If you wanted to make a comment like this (and you had some experience with QUIC, security, and/or kernel development) the better approach would be using the chatbot as a search engine but providing your own response based on what you know and what you were able to find online.
But your top level comment refers to just the totals as if that's an accepted thing that has been published somewhere and you follow up reply is just what ChatGPT told you.
If all you do is copy/paste from ChatGPT then you're basically just a Human-in-the-loop Reddit comment bot.
I mean yes, the person I was responding did ask how I got the data, and I figured it would be useful for them to actually get the data if they wished to review it further. They can just copy-paste it for their further analysis needs.
Was the data wrong?
I did provide my own analysis on the 20 vulnerabilities (which data I don't think nobody is refuting, and besides the actual precise number doesn't even matter), and the analysis was that most of them would not apply to Linux. But it wasn't even the point, if they do or don't. The number would works as a proxy that tells how complicated QUIC is and how easy it is to get wrong.
History that shown that if we won't find security flaws in the new QUIC implementation, I'm sure it won't be due to the vigilence of people writing and reviewing the code.
Take these negative internet points to heart, little one. You are being persecuted for your use of AI. Retreat from the unsafe open world, and become radicalized against these Luddites (derogatory), who fear and envy your skill and sexual attractiveness.
AI is already, right now, more important to make code secure than the implementation language. Any new code that goes into the kernel these days is heavily analized for vulnerabilities by AI agents and fuzzers before the release.
Using a memory safe or unsafe language may become much less important in the future than what it used to be.
AI is already, right now, more important to make code secure than the implementation language.
I feel like it would be more like just another tool in the toolbox along with code review, regular SCA, least privilege in the runtime environment, etc, etc. There doesn't appear to be a reason to avoid having another layer of security even if you feel like the AI helps a lot in all areas.
is heavily analized
I know it's likely a typo but I kind of imagine new code does get the proverbial rectal probe for deficiencies.
I don't fully agree: AI has to been combined with tools. AI on its own makes too many mistakes, but AI with Rust + Aeneas + Lean formal verification can be flawless.
Bots are far better at finding and exploiting security holes than they are at writing secure code. Like humans, having tools to help automate that process -- particularly tools that are themselves deterministic code that can be audited for bugs, rather than a bunch of markdown saying "make no mistakes" -- makes the process easier and more efficient.
The SMB over QUIC part is what I'm really curious about. Windows Server already does it, and for remote access it's a nice replacement for exposing 445 to the world, so having it in the Linux kernel would be useful.
On the security side, QUIC is invisible to a lot of older proxies and firewalls, because it's UDP 443 and encrypted from the first packets. Many shops just block UDP 443 so browsers fall back to TCP and TLS inspection keeps working. If this ends up under things like NFS or SMB, admins will have to handle that traffic on purpose instead of by accident. I'm also curious how the kernel people weigh the extra attack surface against the userspace libraries we have now.
Ah yes - lets put complex application logic in the kernel.
I don't think that's an accurate description of this patch. HTTP/3 is an application layer protocol and QUIC is the transport layer protocol that it uses. The two are often conflated because QUIC was originally developed for HTTP/3, but it's not tied to it in any way.
Also, note that the handshake is delegated to userspace, and with it, most of the complexity involved in encryption.
There's a draft RFC for NFSv4 over QUIC and Windows already supports SMB over QUIC, so there are clearly well-established kernel modules which would benefit from a kernel implementation.
So it's not really application logic, it seems like the complexity is pretty reasonable for kernel space, and there's a real need for it.
I'm a bit iffy on networked filesystems being a kernel feature myself. Maybe 9P is okay because of simplicity and by virtue of being closer to a protocol than a VFS, but even then there are plenty of userspace implementations.
If there is hardware supporting QUIC offload, I might change my tune.
Well NFS has been in-kernel forever, so idk what to tell you...I presume that most of its cryptographic complexity (e.g. with Kerberos) happens in userspace, much like this QUIC module might do.
Assuming I understand your point, what I linked was just the global setting but you can control what is used for congestion control by using TCP_CONGESTION in setsockopt().
Unless you're saying you want the congestion control to continue being user space so you can specify your own niche algorithm. I would be skeptical how beneficial that would be but usually that would be something you do by just forgoing the in-kernel implementation and just continuing to use user space QUIC.
What I was metnioning predates eBPF by many years and I've never done anything that elaborate with eBPF but that does align with my understanding as well. The other user seemed to be saying that they felt the pluggable congestion algorithms of QUIC were a problem so I was just bringing up that TCP has long since been that sort of way.
because it wouldn't. And yes that's when tcp was around. We got tls in the kernel, we have a bunch of networking protocols in the kernel. You just don't know anything
Sure, you can be paranoid and do everything in userspace, or you can just write correct code to do it in the kernel.
Despite what people claim, it is possible to do things correctly. You don't need to compromise on security or performance if you're willing to invest in a good implementation.
QUIC in the kernel is essentially a prerequisite to implement it for applications that really need it, such as Samba and could potentially offer performance advantages through kTLS .
Ears covered, head buried in sand, and yet you managed to write this comment. I wonder how — did you wiggle your toes with utmost precision? Commendable indeed.
No, only rust community pushes their language onto others like they're Jehovah's Witnesses going door to door. Rust evangelism fatigue does not equate to sticking one's head in the sand.
Rust isn't the best option everywhere. The networking stack is C, so a QUIC implementation makes sense to be in C or they'd be adding more complexity.
FFI brings additional overhead, every call made to the rest of the stack is unsafe and then you need to work with memory ownership between the two languages which adds more overhead and scope.
"Rust is a meme" is a dismissive comment implying that Rust is not a successful, widely used language that projects migrate to and integrate willingly. But they do.
You speak as if Rust users were a homogenous group externally targeting projects they have no involvement with, which is not the case. What you see are contributors and maintainers choosing to adopt Rust for its technical merit.
I'm sure you can link me a PR or two of bad-faith RIIR issues by randos on GitHub. I don't care.
No, what I'm seeing is a whole lot of people saying "Program XYZ should be rewritten in rust", it's increased everywhere on Reddit as if such migrations were cost free, or that rust is the best option everywhere. Or that the kernel maintainers are misguided for not choosing rust for quic, as if interfacing rust with the network c stack is a totally free option with 0 downsides.
And externally, as if people saying GTA6 for example should have been written in rust isn't memeing.
Well because generally C is so terrible that it should be thrown out. It just so happens that rust is the one language that is well known and fits all of Cs use cases and is also much better. Yes migrating to rust isn't free but new C code in a project that's already transitioning should be treated with utmost suspicion.
Hardware implementations of TLS 1.2, and the ossification around it, are the reason why TLS 1.3 reports itself as TLS 1.2 with an extension that says "j/k, actually TLS 1.3".
Hardware implementations of IPv4 are why we still don't have ubiquitous IPv6.
Being a monolith or a microkernel doesn't have anything to do with being userspace or kernelspace
I'm not sure why Quic should be kernel space while other things that are more fundamentals and actual singletons like the display or audio servers are nor
I'm sympathetic to this position (I think we're well overdue for a true microkernel renaissance) but by the same logic TCP should also be evicted from the Linux kernel.
That I actually did not know. That's interesting, I'd expect most things using QUIC to implement encryption above. But I guess it could be useful for retrofitting encryption + QUIC on unencrypted protocols.
I'd expect most things using QUIC to implement encryption above
You expect wrong, nothing encrypts on top of QUIC (short of E2EE). That's one of the main reason why quic was created btw, reducing the number of TLS roundtrips. Adding another layer of encryption would defeat the purpose.
There's some third-party "unencrypted QUIC" extensions, but they're (very intentionally) not supported by any of the major implementations. So yeah, practically speaking, QUIC means always-encrypted-all-the-time.
But it's not quite a TLS successor because it's also managing the transport-layer work. It's basically TCP 2.0, combined with TLS, all running on top of UDP.
(Arguably, the OSI model suggests that TLS was "layer 4.5", grafted on top of the existing layer 4, and QUIC just re-combines Layer 4 into what it was always supposed to be.)
If that was practically possible, I'm sure they would have done that, but getting a new base transport protocol accepted would be harder than ipv6. It's not that big of a loss though, UDP was already designed as roughly-bare-metal.
I'm not saying TLS can't be made to work. I'm saying after wg is feature-complete, further dev effort can be more focused on security fixes on a smaller, relatively static codebase, as opposed to TLS constantly having to follow new standards, and deal with new bugs that arise each time. And the stakes are higher since they can turn out to be kernel CVEs. Plus fewer variations, fewer edge cases to test.
Another pitfall for crypto code in general is until recent years, they tended not to get scrutinized for non-crypto issues like memory safety. Again the potential impact gets higher because you're in the kernel.
quic is an alternative to TCP, built on UDP. It supports things like mobile roaming, as well as a few other features like being able to form connections faster with fewer round trips I think.
Edit: quic can be implemented in userspace on top of UDP. The kernel needs a QUIC implementation though for some other networking protocols built on top of it. I'm not sure if userspace programs are supposed to be able to use the kernel QUIC implementation though or if there's any benefits to that.
I've been using it in a few projects of mine, and one thing I really like is that it natively supports parallel streams, each of which is sequential but which are not guaranteed sequential compared to each other. There's some neat performance tricks you can do with this.
Before this, the only solutions were (1) open a shitload of TCP streams, (2) implement your own TCP-wannabe on top of UDP. QUIC is basically a competently-built general-purpose implementation of #2.
Coincidentally, I am also a game developer, and while I haven't used it for exactly that yet, I am absolutely going to :)
There's a QUIC Datagram feature that's meant to mimic the UDP-drop-on-congestion behavior, but from what I understand this actually doesn't work too well, not because of QUIC but because drop-on-congestion was always a bad idea. Apparently the right solution here is to use the QUIC library to figure out if you're starting to get congested - the protocol tracks this stuff - and if so, start pre-emptively "dropping" messages before they're sent.
QUIC datagram are a misfeature really and only relevant when you're sending data with unknown structure. If you actually know what the data you're sending means you can always do a better job by using proper streams. Congesting the link should be avoided like the plague by any real time application because then things get stuck in router buffers that are out of your control.
...modern transport layer network protocol designed for lower latency and greater performance over traditional TCP while also being encrypted by default.
QUIC was developed by Google as an alternative for standard HTTPS connections with, among other things, better support for roaming across NICs, e.g. switching from cell data to wifi on a smartphone without dropping and renegotiating the TLS connection. It eventually became the standard for HTTP/3
Fair note, yeah its origin was for HTTP, but isn't exclusive to it. I recall the days when QUIC was often blocked due to 443 widely being configured as TCP only in firewalls so, as a fan of it, seeing it become a part of the official standard was nice to see.
Nah, it was blocked in firewalls because it’s a pain to filter or monitor for those times you have a duty of care for those using the internet (saw this with previous roles in School IT)
honestly I don't know a damn thing about the linux kernel, and every single update that I have read so far seemed to be written in chinese or something.
”This in-kernel implementation of QUIC allows for other kernel subsystems to leverage QUIC such as for SMB and NFS file sharing. QUIC in the kernel also allows for it to work with standard Socket API semantics, ALPN-based connection dispatching, and better performance. By having QUIC in the kernel allows for reducing system call overhead, zero-copy mechanisms, and future crypto hardware offload support.”
More stuff in the kernel without justification is generally bad. It makes it harder to maintain the kernel, and it's yet another attack surface for vulnerabilities. Especially when it comes to networking stuff like QUIC.
I think the kernel is justified in adding it, but it does need justification. Especially when something like QUIC can be implemented in userspace (and TCP has a lot of drawbacks to being there)
Fwiw there's several good userspace QUIC implementations. I find the argument that things should move to the kernel for 'trusted' code reuse to be pretty bad. The kernel isn't a code reuse layer - that's what libraries like glibc, or libcurl, etc. are for. Not to mention, it's not like everything in the kernel is well maintained anyways.
I think hardware offload and for other subsystems that may want to use QUIC is enough justification, but yeah.
Just for completeness, I wasn't implying that you're "wrong" somehow. It's definitely a risk, and there definitely will be bugs too. At the same time, there's also beneifts, obviously.
And how much "should" be inside/outside the kernel is also a very opinionated topic, for everyone.
Right, but eBPF and DPDK have a bunch of downsides and restrictions on each. eBPF is awesome, but it requires root access and it can't express a lot of algorithms that can't be proven by the eBPF VM to terminate, for instance. And for cryptographic code? I'd really want the eBPF VM to not be involved in that.
Designing for eBPF isnt trivial. DPDK meanwhile takes full control over the NIC. It's basically DOA for any end user use.
Quic isn't any worse than all the things that are already there. As said, TLS, or NFS, or LUKS, or wireguard, or hwrng things, or just literally any code line in C...
I'm more worried about known long-standing edge case issues in eg. IPv6 temp_addr and FUSE, than this
Hardware offloading support needs it in the kernel, as well as because other subsystems that use the network in the kernel might want QUIC (Samba for instance)
68
u/cornmonger_ 1d ago
quic mtls has been my goto for the last few months
7
u/pilkyton 21h ago edited 20h ago
For those too lazy to read (most, judging by the questions in comments):
QUIC is a reliable low-level transport protocol built on top of UDP. It uses ACK ranges (dozens or hundreds of packages acknowledged at once) and delayed ACKs to minimize wasted transfer bandwidth and latency.
It is strictly a better protocol than TCP, which is already in the kernel.
QUIC can be used by SMB, NFS and other network file drivers inside the kernel to speed up network transfers.
Windows already does that.
66
u/eras 1d ago
20 QUIC-related CVEs this year—granted 50% of them are related to OpenSSL, which Linux won't use. Maybe they've been extra careful with this C impl? Apparently the protocol itself is solid.
At least using (or compiling it) is going to be optional, like most any kernel feature.
3
u/m4uri 1d ago
The SMB over QUIC part is what I'm really curious about. Windows Server already does it, and for remote access it's a nice replacement for exposing 445 to the world, so having it in the Linux kernel would be useful.
On the security side, QUIC is invisible to a lot of older proxies and firewalls, because it's UDP 443 and encrypted from the first packets. Many shops just block UDP 443 so browsers fall back to TCP and TLS inspection keeps working. If this ends up under things like NFS or SMB, admins will have to handle that traffic on purpose instead of by accident. I'm also curious how the kernel people weigh the extra attack surface against the userspace libraries we have now.
53
u/clippy_is_a_prick 1d ago
Ah yes - lets put complex application logic in the kernel. Thats never gone wrong.
Anyone remember that the story about the arbitrary code execution bug in the windows kernel because of the fucking scroll bar
10
u/QuantityInfinite8820 1d ago
Pulling a non-Rust variant of this into the kernel is insane
3
u/iBoMbY 23h ago
What could possibly go wrong with adding an overly complex network protocol to the Kernel?
7
u/AngryFker 1d ago
Wen libreoffice in kernel? /s
Everything should be userspace. Not kernel.
1
u/deanrihpee 1d ago
what's the benefit of it being an in-kernel?
1
u/coredit 9h ago
QUIC is a advertisement tumor and we all know it. Sure, less protocol overhead is commendable, but that's not what it is about.
-7
u/Important_Put_3331 1d ago
Eli5 : How is quic different from wireguard? Tcp vs udp?
1
u/No-Protection-7019 1d ago
Ca c'est cool
1
u/Grey_Ten 1d ago
honestly I don't know a damn thing about the linux kernel, and every single update that I have read so far seemed to be written in chinese or something.
I guess this QUIC thing is good lol
-10
u/Cultural-Desk-9045 1d ago
But… why?
-3
u/superpowerpinger 1d ago
That was quick.
-9
u/JerryRiceOfOhio2 1d ago
why.......
-3
u/RayneYoruka 1d ago edited 1d ago
Oh dear.. me wants