4 ms·
It's weird to have strong opinions about userspace here given that the code search Kees Cook provided includes only test cases (and, amusingly, what looks like
by tptacek 5y ago
It's weird to have strong opinions about userspace here given that the code search Kees Cook provided includes only test cases (and, amusingly, what looks like one piece of shellcode) --- the followup search on `execlp` turned up some things that looked like they might be non-test hits, but it turned out that only the test case hits were argc==0.
There's also comments throughout the thread that POSIX requires programs to accept argc==0, which does not appear to be the case --- the opposite seems closer to the truth, in that "strictly conforming" POSIX programs must have argc>0.
Not breaking userspace is an important goal, but breaking bad test cases doesn't meaningfully break userland.
The flip side of this is that people went looking for additional instances of the pkexec bug and none have, as far as I can see, turned up yet.
- tedunangst 5y ago"But what if it breaks userland" does seem to be something of a fig leaf. Change would imply there may have been something wrong with the previous code.
- stormbrew 5y agoYes this. This really feels like a vast over-extension of the "don't break userland" axiom. It's obvious with only a little thought that many bugs in a kernel can be accidentally relied on somehow, and many almost certainly have been and have still been fixed in the linux kernel anyways (maybe by accident). It seems like a Linus quote from one of his notorious angry emails turned into a meme that got out of hand and now people are taking it too seriously. And yeah, the posix quotes that have been presented paint a picture much more like "posix doesn't demand you not support null/empty argv or argc==0, but it would prefer you not" to me.
- mst 5y agoGiven "BSD systems already prohibit an empty argv" it certainly seems unlikely that it's a standards related issue in practice. So (as they appear to be doing if I read correctly) keeping the patch in the tree for the moment, seeing what if anything actually breaks in practice, and then trying to figure out what the best answer is from there, is probably the only thing to do. It's always a horrible day for a developer when they discover they have a bugwards compatibility problem and while it's, I guess, debatable if that's exactly what we're seeing here, it's close enough to the pain I know well that I have much sympathy for everybody involved here.