qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "wangjie (P)" <wangjie88@huawei.com>,
	Michal Privoznik <mprivozn@redhat.com>
Cc: zhangjixiang2@huawei.com, oscar.zhangbo@huawei.com,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Fangyi \(C\)" <eric.fangyi@huawei.com>
Subject: Re: [Qemu-devel]  question:about pr-helper unlink sock file fail
Date: Tue, 18 Jun 2019 19:34:20 +0200	[thread overview]
Message-ID: <2e914d2e-798f-311f-f189-8b4ca23fc270@redhat.com> (raw)
In-Reply-To: <7462792e-687f-b4b9-5242-5abccd318deb@huawei.com>

On 17/06/19 06:10, wangjie (P) wrote:
> Hi, I found there is a bug in pr-helper:
> 
>     We run pr-helper process in root, and drop all capabilities  expect
> CAP_SYS_RAWIO.
> 
>     But the sock file which connect from qemu is owned by qemu group,
> when pr-helper exit, 
> 
>     it will call  “close_server_socket ->
> object_unref(OBJECT(server_ioc)) -> qio_channel_socket_finalize ->
> socket_listen_cleanup” ,
> 
>     unlink sock file  will fail and output “Failed to unlink socket xxx,
> Permission denied”.
> 
>       I tried to add capability CAP_DAC_OVERRIDE in pr-helper, it will
> unlink sock success, but I think capability CAP_DAC_OVERRIDE is too
> dangerous.

Interesting... yeah, CAP_DAC_OVERRIDE is a big big hammer.  I think this
would be fixed by also changing owner and group of the pr-helper to
qemu; it should work because it uses CAP_SYS_RAWIO.

Paolo


      reply	other threads:[~2019-06-18 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17  4:10 [Qemu-devel] question:about pr-helper unlink sock file fail wangjie (P)
2019-06-18 17:34 ` 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=2e914d2e-798f-311f-f189-8b4ca23fc270@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=eric.fangyi@huawei.com \
    --cc=mprivozn@redhat.com \
    --cc=oscar.zhangbo@huawei.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wangjie88@huawei.com \
    --cc=zhangjixiang2@huawei.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).