|
|
Subscribe / Log in / New account

Systemd catches up with bind events

Systemd catches up with bind events

Posted Nov 14, 2020 1:03 UTC (Sat) by dxin (guest, #136611)
Parent article: Systemd catches up with bind events

Probably it's a good idea to end every enum definition with a RESERVED so that users are forced to handle future extensions.


to post comments

Systemd catches up with bind events

Posted Nov 14, 2020 1:40 UTC (Sat) by Paf (subscriber, #91811) [Link] (7 responses)

How does that force them to handle extensions? (Legitimate question, not criticism)

Systemd catches up with bind events

Posted Nov 14, 2020 8:32 UTC (Sat) by TheGopher (subscriber, #59256) [Link] (1 responses)

Agreed - RESERVED_FOR_FUTURE_EXPANSION is a clearer indicator - but I do understand OP's point - it's the difference between a closed set and a potentially open set.

Systemd catches up with bind events

Posted Nov 15, 2020 20:41 UTC (Sun) by NYKevin (subscriber, #129325) [Link]

Eh, I'm unconvinced. IPv4 did that with Class E addresses, back when classful networking was still a thing. Nowadays, classes are otherwise dead, we're running short of addresses, and Class E (now known as 240.0.0.0/4) is still "reserved for future expansion" - because everyone hard-coded it as invalid, sometimes even at the hardware level. So you can't use 240/4 without losing backwards compatibility. But if you're going to do a compatibility break anyway, you're far better off switching to IPv6 altogether, as it gives you far more addresses to play with and is generally less of a hassle to administer (for example, it lacks NAT). So those ~268 million IPv4 addresses will likely never be publicly routable.

Perhaps the RFCs of the time could have been written with greater care, but the trouble is that at the time (see RFC 988), they were in the process of designating class D (224.0.0.0/4) as multicast. They didn't know what class E would be used for, so they couldn't just say "treat class E as if it were unicast, unless a later standard says otherwise." For all they knew at the time, they would later want to use class E for some even weirder thing, and unicast processing would have been inappropriate or even harmful. So they just left it as "reserved," and the people who had to actually make the silicon and software decided that "reserved" meant "invalid." IMHO, they didn't really have much of a choice.

In short: From userspace's perspective, "reserved for future expansion" means "I don't know what this value represents, so if the kernel hands it to me, the only not-wrong thing I can possibly do is crash." In some contexts, ignoring the value *might* be not-wrong, but it's hard for userspace to predict that in advance. Regardless, the kernel cannot rely on userspace taking any particular interpretation, because as Linus has previously said, they don't break userspace, even where userspace is wrong.

Systemd catches up with bind events

Posted Nov 14, 2020 9:53 UTC (Sat) by ballombe (subscriber, #9523) [Link] (2 responses)

because in some case, gcc will say
"warning: enum RESERVED not handled in switch".

Systemd catches up with bind events

Posted Nov 14, 2020 10:57 UTC (Sat) by embe (subscriber, #46489) [Link] (1 responses)

And of course then you add default: abort(); to make the warning go away and everything is fine ;)

Systemd catches up with bind events

Posted Nov 15, 2020 11:15 UTC (Sun) by tinko92 (guest, #102129) [Link]

Well, at least that might cause a visible crash at a line of code that points to the cause of the issue rather than a, maybe initially invisible, corruption of the programs state.

Systemd catches up with bind events

Posted Nov 18, 2020 9:30 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

Be VERY evil and send nonsensical events with random names?

This is actually a thing in TLS. At least several TLS implementations send deliberately non-existing cipher suite names during negotiation to make sure that middleboxes don't encode stuff like "use the first cipher".

Systemd catches up with bind events

Posted Nov 19, 2020 14:49 UTC (Thu) by kpfleming (subscriber, #23250) [Link]

So much this. A kernel config option which causes random, undocumented, events to appear, both for existing devices and for 'nonsense' devices. Correctly formatted messages (e.g. not fuzzing), but with types that are never used for real devices.

Chaos engineering can be quite useful.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds