All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: scott.davis@starlab.io, christopher.clark@starlab.io,
	jandryuk@gmail.com, Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 2/3] xsm: consolidate loading the policy buffer
Date: Tue, 31 May 2022 13:02:06 -0400	[thread overview]
Message-ID: <0c9a0874-6afb-0ac0-fc6d-26d14081efe3@apertussolutions.com> (raw)
In-Reply-To: <53a64002-5369-26b9-cd30-119983518cc6@suse.com>

On 5/31/22 12:05, Jan Beulich wrote:
> On 31.05.2022 17:08, Daniel P. Smith wrote:
>> Previously, initializing the policy buffer was split between two functions,
>> xsm_{multiboot,dt}_policy_init() and xsm_core_init(). The latter for loading
>> the policy from boot modules and the former for falling back to built-in policy.
>>
>> This patch moves all policy buffer initialization logic under the
>> xsm_{multiboot,dt}_policy_init() functions. It then ensures that an error
>> message is printed for every error condition that may occur in the functions.
>> With all policy buffer init contained and only called when the policy buffer
>> must be populated, the respective xsm_{mb,dt}_init() functions will panic if an
>> error occurs attempting to populate the policy buffer.
> 
> "flask=late" is also a mode where, afaict, no policy is required. I can't,
> however, see how you're taking care of that (but maybe I'm overlooking
> something); inspecting flask_bootparam in generic XSM code would actually
> be a layering violation.

Good point, flask=late is meant to be enforcing with a late loading of a
policy file. I will address it.

>> --- a/xen/include/xsm/xsm.h
>> +++ b/xen/include/xsm/xsm.h
>> @@ -775,7 +775,7 @@ int xsm_multiboot_init(
>>      unsigned long *module_map, const multiboot_info_t *mbi);
>>  int xsm_multiboot_policy_init(
>>      unsigned long *module_map, const multiboot_info_t *mbi,
>> -    void **policy_buffer, size_t *policy_size);
>> +    const unsigned char *policy_buffer[], size_t *policy_size);
> 
> I don't think we're dealing with an array here, so const unsigned char **
> would seem the more correct representation to me.
> 
> Also - what about the DT counterpart function?

Ack.

v/r
dps


  reply	other threads:[~2022-05-31 17:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 15:08 [PATCH v3 0/3] xsm: refactor and optimize policy loading Daniel P. Smith
2022-05-31 15:08 ` [PATCH v3 1/3] xsm: only search for a policy file when needed Daniel P. Smith
2022-05-31 15:51   ` Jan Beulich
2022-05-31 16:15     ` Daniel P. Smith
2022-06-01  6:04       ` Jan Beulich
2022-06-07 12:07         ` Daniel P. Smith
2022-06-01  6:08   ` Jan Beulich
2022-06-07 12:08     ` Daniel P. Smith
2022-05-31 15:08 ` [PATCH v3 2/3] xsm: consolidate loading the policy buffer Daniel P. Smith
2022-05-31 16:05   ` Jan Beulich
2022-05-31 17:02     ` Daniel P. Smith [this message]
2022-05-31 15:08 ` [PATCH v3 3/3] xsm: properly handle error from XSM init Daniel P. Smith
2022-06-01  6:14   ` Jan Beulich
2022-06-07 12:14     ` Daniel P. Smith
2022-06-07 13:21       ` 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=0c9a0874-6afb-0ac0-fc6d-26d14081efe3@apertussolutions.com \
    --to=dpsmith@apertussolutions.com \
    --cc=christopher.clark@starlab.io \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=jandryuk@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=scott.davis@starlab.io \
    --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.