All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Juergen Gross <jgross@suse.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [xen-unstable test] 123379: regressions - FAIL
Date: Wed, 13 Jun 2018 01:21:04 -0600	[thread overview]
Message-ID: <5B20C5E002000078001CAB80@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <5114deec-74a6-1905-4fec-5c7511d6f4b1@suse.com>

>>> On 13.06.18 at 08:50, <jgross@suse.com> wrote:
> On 13/06/18 08:11, Jan Beulich wrote:
>> Teaching the privcmd driver of all
>> the indirections in hypercall request structures doesn't look very
>> attractive (or maintainable). Or are you thinking of the caller
>> providing sideband information describing the buffers involved,
>> perhaps along the lines of how dm_op was designed?
> 
> I thought about that, yes. libxencall already has all the needed data
> for that. Another possibility would be a dedicated ioctl for registering
> a hypercall buffer (or some of them).

I'm not sure that's an option: Is it legitimate (secure) to retain the
effects of get_user_pages() across system calls?

>> There's another option, but that has potentially severe drawbacks
>> too: Instead of returning -EFAULT on buffer access issues, we
>> could raise #PF on the very hypercall insn. Maybe something to
>> consider as an opt-in for PV/PVH, and as default for HVM.
> 
> Hmm, I'm not sure this will solve any problem. I'm not aware that it
> is considered good practice to just access a user buffer from kernel
> without using copyin()/copyout() when you haven't locked the page(s)
> via get_user_pages(), even if the buffer was mlock()ed. Returning
> -EFAULT is the right thing to do, I believe.

But we're talking about the very copyin()/copyout(), just that here
it's being amortized by doing the operation just once (in the
hypervisor). A #PF would arise from syscall buffer copyin()/copyout(),
and the suggestion was to produce the same effect for the squashed
operation. Perhaps we wouldn't want #PF to come back from ordinary
(kernel invoked) hypercalls, but ones relayed by privcmd are different
in many ways anyway (see the stac()/clac() pair around the actual
call, for example).

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-06-13  7:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31  6:00 [xen-unstable test] 123379: regressions - FAIL osstest service owner
2018-05-31  8:32 ` Juergen Gross
2018-05-31  9:14   ` Juergen Gross
2018-06-01  8:10     ` Jan Beulich
2018-06-01  9:08       ` Juergen Gross
2018-06-05 16:16         ` Ian Jackson
2018-06-06  7:39           ` Juergen Gross
2018-06-05 16:19         ` Ian Jackson
2018-06-06  9:35           ` Jan Beulich
     [not found]           ` <5B17AAE102000078001C8972@suse.com>
2018-06-06  9:40             ` Juergen Gross
2018-06-07 11:30               ` Juergen Gross
2018-06-08 10:12                 ` Juergen Gross
2018-06-12 15:58                   ` Juergen Gross
2018-06-13  6:11                     ` Jan Beulich
     [not found]                     ` <5B20B5A602000078001CAACA@suse.com>
2018-06-13  6:50                       ` Juergen Gross
2018-06-13  7:21                         ` Jan Beulich [this message]
     [not found]                         ` <5B20C5E002000078001CAB80@suse.com>
2018-06-13  7:57                           ` Juergen Gross
2018-06-13  8:52                     ` Juergen Gross
2018-06-13  8:58                       ` Andrew Cooper
2018-06-13  9:02                         ` Juergen Gross
2018-06-08 14:25         ` Ad-hoc test instructions (was Re: [xen-unstable test] 123379: regressions - FAIL) Ian Jackson
2018-06-08 15:42           ` Juergen Gross

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=5B20C5E002000078001CAB80@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.