This addresses a vulnerability introduced in D62718.
chmod u+s,g+s,o+x a sudo llvm-strip a // a should not have set-user-ID or set-group-ID bits
No test because it is not testable on all file systems.
Differential D96292
[llvm-objcopy] Drop S_ISUID and S_ISGID bits MaskRay on Feb 8 2021, 2:10 PM. Authored by
Details This addresses a vulnerability introduced in D62718. chmod u+s,g+s,o+x a sudo llvm-strip a // a should not have set-user-ID or set-group-ID bits No test because it is not testable on all file systems.
Diff Detail
Unit Tests Event TimelineComment Actions This address llvm-strip exe and llvm-strip exe -o out. https://sourceware.org/pipermail/binutils/2021-February/115282.html binutils is move to conditional in-place overwrite. I can sign up the work for llvm-objcopy. Comment Actions This change actually makes our behavior consistent with current GNU strip/objcopy. GNU strip/objcopy does not copy S_ISUID and S_ISGID bits. chmod u+s,g+s,o+x a sudo llvm-strip a -o b Currently b has S_ISUID and S_ISGID bits. Comment Actions Thanks @MaskRay for the example. Comment Actions I investigated the old and new binutils behaviors a bit. I think we need to do D97253: If input=output, preserve umask bits, otherwise drop S_ISUID/S_ISGID bits chmod u+s,g+s,o+x a sudo llvm-strip a -o b is still a case that we want to change to match cp |