All of lore.kernel.org
 help / color / mirror / Atom feed
From: Norbert Manthey <nmanthey@amazon.de>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Ian Jackson" <iwj@xenproject.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH HVM v2 1/1] hvm: refactor set param
Date: Fri, 12 Feb 2021 13:28:33 +0100	[thread overview]
Message-ID: <2633df5f-df68-4a16-bc5c-522b2a589b00@amazon.de> (raw)
In-Reply-To: <a48464da-659a-1dea-0b1f-fdd264b1db69@suse.com>


On 2/12/21 11:04 AM, Jan Beulich wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
>
>
>
> On 11.02.2021 21:46, Norbert Manthey wrote:
>> I agree with the symmetry for get and set. This is what I'd aim for:
>>
>>  1. hvmop_set_param and hvmop_get_param (static) both check for the
>> index, and afterwards use the is_hvm_domain(d) function with its barrier
>>  2. hvm_set_param (static) and hvm_get_param both call their allow
>> helper function, evaluate the return code, and afterwards block speculation.
>>  2.1. hvm_get_param is declared in a public header, and cannot be turned
>> into a static function, hence needs the index check
> But both further call sites are in bounded loops, with the bounds not
> guest controlled. It can rely on the callers just as much as ...
Okay, so I will not add the check there either. I thought about future
modifications that allow to call that function from other places, or
modified call environments with eventually guest control - but I am fine
to not consider these.
>
>>  2.2. hvm_set_param is only called from hvmop_set_param, and index is
>> already checked there, hence, do not add check
> ... this.
>
>>  3. hvm_allow_set_param (static) and hvm_allow_get_param (static) do not
>> validate the index parameter
>>  3.1. hvm_allow_set_param blocks speculative execution with a barrier
>> after domain permissions have been evaluated, before accessing the
>> parameters of the domain. hvm_allow_get_param does not access the params
>> member of the domain, and hence does not require additional protection.
>>
>> To simplify the code, I propose to furthermore make the hvmop_set_param
>> function static as well.
> Yes - this not being so already is likely simply an oversight,
> supported by the fact that there's no declaration in any header.

Okay.

Best,
Norbert




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



  reply	other threads:[~2021-02-12 12:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 20:39 [PATCH HVM v2 1/1] hvm: refactor set param Norbert Manthey
2021-02-08 14:21 ` Jan Beulich
2021-02-08 19:47   ` Norbert Manthey
2021-02-08 20:00     ` [PATCH HVM v3 " Norbert Manthey
2021-02-09 10:06       ` Jan Beulich
2021-02-09  9:40     ` [PATCH HVM v2 " Jan Beulich
2021-02-09 13:41       ` Norbert Manthey
2021-02-09 13:45         ` Jan Beulich
2021-02-09 13:56           ` Norbert Manthey
2021-02-09 14:21             ` Jan Beulich
2021-02-11 20:46               ` Norbert Manthey
2021-02-12 10:04                 ` Jan Beulich
2021-02-12 12:28                   ` Norbert Manthey [this message]
2021-02-18 15:01                     ` [PATCH HVM v4 " Norbert Manthey
2021-02-19 13:44                       ` Jan Beulich

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=2633df5f-df68-4a16-bc5c-522b2a589b00@amazon.de \
    --to=nmanthey@amazon.de \
    --cc=andrew.cooper3@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --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.