qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libcap vs libcap-ng mess


From: Paolo Bonzini
Subject: Re: libcap vs libcap-ng mess
Date: Fri, 29 Nov 2019 19:12:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 29/11/19 19:01, Dr. David Alan Gilbert wrote:
>> It's not entirely trivial because fsdev-proxy-helper wants to keep the
>> effective set and clear the permitted set; in libcap-ng you can only
                     ^^^^^

(Wrong, this is "modify" the permitted set.  The permitted set is
already cleared by setresuid/setresgid).

>> apply both sets at once, and you cannot choose only one of them in
>> capng_clear/capng_get_caps_process.  But it's doable, I'll take a look.
> I'm having some difficulties making the same conversion for virtiofsd;
> all it wants to do is drop (and later recover) CAP_FSETID
> from it's effective set;  so I'm calling capng_get_caps_process
> (it used to be cap_get_proc).  While libcap survives just using the
> capget syscall, libcap-ng wants to read /proc/<TID>/status - and
> that's a problem because we're in a sandbox without /proc mounted
> at that point.

The state of libcap-ng persists after capng_apply.  So you can just call
capng_update({CAP_ADD,CAP_DROP}) followed by capng_apply.

Does virtiofsd have to do uid/gid dances like virtfs-proxy-helper?

Thanks,

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]