Re:Handling argc==0 in the Linux kernel
by asveikau on Friday February 04, 2022 @07:06PM
(#30215380)
I don't see why pushing this out to glibc would help. Glibc would then face the same question about whether or not some programs rely on current behavior and would break.
[ Parent
| on HN ]
Linus' views on backcompat and glibc's have, let us say, not been entirely aligned over the years.
If the change fails at the kernel level but succeeds at the glibc level that might still be a net win overall, and given Ariadne as "instigator" here I'd be hopeful that she could convince musl to come along for the ride if that was how it had to happen. (assuming she thought that was a good idea in the first place, of course, I'm exploring counterfactuals here)
Re:Handling argc==0 in the Linux kernel
by isomel on Saturday February 05, 2022 @01:09AM
(#30218234)
But a "fix" in libc wouldn't help for the security risk because an attacker could still emit the system call directly.
(Unless I misunderstood what the fix would be)
Re:Handling argc==0 in the Linux kernel
by asveikau on Saturday February 05, 2022 @01:18AM
(#30218300)
At first I imagine the libc killing the process if argv is empty.
Otoh if you want libc to be possibly a little too clever, perhaps it could make an effort to try to discover a sensible value for argv[0] based on looking around /proc etc to find the path to the binary. That seems like way too much complexity and failure points for a few mostly inconsequential corner cases.
Re:Handling argc==0 in the Linux kernel
by thingsgoup on Saturday February 05, 2022 @07:24AM
(#30220362)
If libc isn’t linked into the process to begin with then none of that matters.