Fixing broken userspace is NOT the kernel's job
Fixing broken userspace is NOT the kernel's job
Posted Apr 30, 2012 18:19 UTC (Mon) by drag (guest, #31333)In reply to: Fixing broken userspace is NOT the kernel's job by pr1268
Parent article: Fixing the unfixable autofs ABI
Plus I don't understand why it's so terrible that systemd checks to make sure that the data it's getting from the kernel is the correct size.
Posted Apr 30, 2012 21:16 UTC (Mon)
by man_ls (guest, #15091)
[Link] (3 responses)
Posted Apr 30, 2012 21:19 UTC (Mon)
by felixfix (subscriber, #242)
[Link]
Posted May 1, 2012 8:03 UTC (Tue)
by mjt (guest, #1515)
[Link] (1 responses)
Now, reading just 300 bytes (size of that packet on 32bit userspace) instead of 304 bytes which a 64bit kernel sent to userspace does the trick, but the pipe buffer now holds 4 bytes, which will be read by userspace as a NEW packet. Even if new packet actually arrives, for the userspace the result will be complete garbage, since the packet boundary got lost.
At any rate, no userspace trick will fix already released versions of userspace applications, which is the whole point. Yes it could be made differently, but what's done is done and we don't want to break it.
Posted May 1, 2012 18:34 UTC (Tue)
by dlang (guest, #313)
[Link]
Posted May 4, 2012 17:44 UTC (Fri)
by giraffedata (guest, #1954)
[Link]
Here's a closer analogy: John has 12 steps in his house. He likes to walk down them with his eyes closed and count the steps. Mary invites John over to her house and he resists, saying "I know where everything is in my house and I'm afraid I would get lost in your house." Mary assures him that her house is just like his in every relevant detail, and on that basis John accepts. But Mary has 13 steps and John, walking down with his eyes closed and counting to 12, falls and breaks his arm. Should Mary pay for his medical bills?
Did Mary break her promise? Is having one more step in the staircase is a relevant detail? Is a person entitled to walk down stairs with his eyes closed?
We typically say you can move a program from a 32 bit computer to a 64 bit one without change because the environment is the same in every relevant detail. We also say you can move a program from kernel release N to N+1 for the same reason. Automount and Systemd users are relying on some interpretation of those promises.
But why check only for exactly 300 bytes? It would be understandable if systemd would check that the size of the data is >=300. That way there would be room to add padding or even new fields at the end, if needed.
Magic numbers
Magic numbers
Magic numbers
Magic numbers
That's the wrong analogy for this debate. I'm sure you can think of a 100 cases where users got burned by a design decision in a user space program 5 years ago, and a kernel change today could compensate for it, but the consensus is the users should suffer.
Fixing broken userspace is NOT the kernel's job