
Linus Torvalds, father of the Linux kernel (and thus a lot of the software you use) had a meltdown last week β and it was epic.
Someone who (apparently) made a pull request for Linux version 4.3 submitted networking code Torvalds didnβt like, and he went all the way off.
Hereβs the full response. Even if some of the technical language is over your head, enjoy his full-on rant:
Christ people. This is just sh*t.
The conflict I get is due to stupid new gcc header file crap. But what
makes me upset is that the crap is for completely bogus reasons.This is the old code in net/ipv6/ip6_output.c:
mtu -= hlen + sizeof(struct frag_hdr);
and this is the new βimprovedβ code that uses fancy stuff that wants
magical built-in compiler support and has silly wrapper functions for
when it doesnβt exist:if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) ||
mtu <= 7)
goto fail_toobig;and anybody who thinks that the above is
(a) legible
(b) efficient (even with the magical compiler support)
(c) particularly safeis just incompetent and out to lunch.
The above code is sh*t, and it generates shit code. It looks bad, and
thereβs no reason for it.The code could *easily* have been done with just a single and
understandable conditional, and the compiler would actually have
generated better code, and the code would look better and more
understandable. Why is this notif (mtu < hlen + sizeof(struct frag_hdr) + 8)
goto fail_toobig;
mtu -= hlen + sizeof(struct frag_hdr);which is the same number of lines, doesnβt use crazy helper functions
that nobody knows what they do, and is much more obvious what it
actually does.I guarantee that the second more obvious version is easier to read and
understand. Does anybody really want to dispute this?Really. Give me *one* reason why it was written in that idiotic way
with two different conditionals, and a shiny new nonstandard function
that wants particular compiler support to generate even half-way sane
code, and even then generates worse code? A shiny function that we
have never ever needed anywhere else, and that is just
compiler-masturbation.And yes, you still could have overflow issues if the whole βhlen +
xyzβ expression overflows, but quite frankly, the βoverflow_usub()β
code had that too. So if you worry about that, then you damn well
didnβt do the right thing to begin with.So I really see no reason for this kind of complete idiotic crap.
Tell me why. Because Iβm not pulling this kind of completely insane
stuff that generates conflicts at rc7 time, and that seems to have
absolutely no reason for being anm idiotic unreadable mess.The code seems *designed* to use that new βoverflow_usub()β code. It
seems to be an excuse to use that function.And itβs a f*cking bad excuse for that braindamage.
Iβm sorry, but we donβt add idiotic new interfaces like this for
idiotic new code like that.Yes, yes, if this had stayed inside the network layer I would never
have noticed. But since I *did* notice, I really donβt want to pull
this. In fact, I want to make it clear to *everybody* that code like
this is completely unacceptable. Anybody who thinks that code like
this is βsafeβ and βsecureβ because it uses fancy overflow detection
functions is so far out to lunch that itβs not even funny. All this
kind of crap does is to make the code a unreadable mess with code that
no sane person will ever really understand what it actually does.Get rid of it. And I donβt *ever* want to see that shit again.
Linus
TL;DR β Pwned.
Orβ¦
Linus Torvalds: still a giant asshole. https://t.co/Vqbm4d0zQm
β Justin Williams (@justin) November 2, 2015
β€ Re: Git Networking [Linux-Kernel Archive via Gizmodo]
Get the TNW newsletter
Get the most important tech news in your inbox each week.