qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
	"P. Berrange, Daniel" <berrange@redhat.com>,
	qemu-devel@nongnu.org, vgoyal@redhat.com
Subject: Re: libcap vs libcap-ng mess
Date: Mon, 2 Dec 2019 11:33:29 +0100	[thread overview]
Message-ID: <7f8d4bf2-1a75-efa4-4c3f-e774d761b872@redhat.com> (raw)
In-Reply-To: <20191202100731.GB2904@work-vm>

On 02/12/19 11:07, Dr. David Alan Gilbert wrote:
> * Paolo Bonzini (pbonzini@redhat.com) wrote:
>> Il ven 29 nov 2019, 19:54 Dr. David Alan Gilbert <dgilbert@redhat.com> ha
>> scritto:
>>
>>>> Yes, it's per thread.  The state can be built from
>>>> capng_clear/capng_get_caps_process + capng_update, and left in there
>>>> forever.  There is also capng_save_state/capng_restore_state which, as
>>>> far as I can see from the sources, can be used across threads.
>>>
>>> So, I think what you're saying is I need to:
>>>   a) Before we sandbox do the capng_get_caps_process
>>>
>>
>> Why not after sandboxing?
> 
> Because in our sandbox we don't have /proc and capng_get_caps_process
> tries to read /proc/.../status and fails. The old libcap code doesn't
> use /proc, it just uses capget (which the new one also uses).

"In the middle of sandboxing" would have been a more precise suggestion.
 In the virtio-9p proxy I set up the state right after the sandboxing
capng_apply, so that there is no need to do capng_get_caps_process (the
libcap virtio-9p also used cap_get_proc).  So you could capng_save_state
there.

Paolo



      reply	other threads:[~2019-12-02 10:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28 19:04 libcap vs libcap-ng mess Dr. David Alan Gilbert
2019-11-29  9:34 ` Daniel P. Berrangé
2019-11-29 10:46   ` Paolo Bonzini
2019-11-29 10:51     ` Dr. David Alan Gilbert
2019-11-29 18:01     ` Dr. David Alan Gilbert
2019-11-29 18:12       ` Paolo Bonzini
2019-11-29 18:20         ` Dr. David Alan Gilbert
2019-11-29 18:27           ` Paolo Bonzini
2019-11-29 18:54             ` Dr. David Alan Gilbert
2019-11-29 23:19               ` Paolo Bonzini
2019-12-02 10:07                 ` Dr. David Alan Gilbert
2019-12-02 10:33                   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f8d4bf2-1a75-efa4-4c3f-e774d761b872@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).