On Tue, Feb 25, 2020 at 10:39:33PM +0000, Dmitry V. Levin wrote:<br>
> On Tue, Feb 25, 2020 at 04:05:10AM -0800, Dmytro Kolomoiets wrote:<br>
> > Literally. This works:<br>
> > ```bash<br>
> > $ sudo strace -qqu $USER -e trace=execve -e signal=none -- sudo true<br>
> > <br>
> > execve("/usr/bin/sudo", ["sudo", "true"], 0x7ffe1fc6b730 /* 13 vars */) = 0<br>
> > ```<br>
> > And this not:<br>
> > ```bash<br>
> > $ sudo strace --seccomp-bpf -fqqu $USER -e trace=execve -e signal=none -- sudo true<br>
> > <br>
> > execve("/usr/bin/sudo", ["sudo", "true"], 0x7ffc693481d8 /* 13 vars */) = 0<br>
> > sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?<br>
> > <br>
> > ```<br>
> > Is it temporary regression or `--seccomp-bpf` is fundamentally impossible for this usecase?<br>
> <br>
> This is a limitation of the current implementation which sets<br>
> PR_SET_NO_NEW_PRIVS unconditionally.  Apparently, in an unlikely case when<br>
> strace is privileged enough, there is no need to set PR_SET_NO_NEW_PRIVS.<br>
<br>
Another complication is that strace installs the seccomp filter as late as<br>
possible before execve, that is, strace -u $USER switches to $USER and<br>
therefore drops privileges before installing the seccomp filter, which<br>
means setting PR_SET_NO_NEW_PRIVS in case of strace -u seems to be<br>
unavoidable.<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/strace/strace/issues/126?email_source=notifications&email_token=AOVBTR43HCTPJEFM2K7JKBDREWUD7A5CNFSM4K3G2HG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM6BP7A#issuecomment-591140860">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AOVBTR2LPMH73DGXXZZVZILREWUD7ANCNFSM4K3G2HGQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AOVBTR46JL35EDNP2BTXBQTREWUD7A5CNFSM4K3G2HG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM6BP7A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/strace/strace/issues/126?email_source=notifications\u0026email_token=AOVBTR43HCTPJEFM2K7JKBDREWUD7A5CNFSM4K3G2HG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM6BP7A#issuecomment-591140860",
"url": "https://github.com/strace/strace/issues/126?email_source=notifications\u0026email_token=AOVBTR43HCTPJEFM2K7JKBDREWUD7A5CNFSM4K3G2HG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM6BP7A#issuecomment-591140860",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>