All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <iwj@xenproject.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 7/7] xsm: removing facade that XSM can be enabled/disabled
Date: Mon, 30 Aug 2021 15:34:40 +0200	[thread overview]
Message-ID: <fb8bc2d1-caa1-3cbf-0796-5578faec41bd@suse.com> (raw)
In-Reply-To: <94d6914c-57d4-e63b-1abe-88ef14186344@apertussolutions.com>

On 30.08.2021 14:11, Daniel P. Smith wrote:
> On 8/26/21 5:37 AM, Jan Beulich wrote:
>> On 05.08.2021 16:06, Daniel P. Smith wrote:
>>>  config XSM_FLASK
>>> -	def_bool y
>>> -	prompt "FLux Advanced Security Kernel support"
>>> -	depends on XSM
>>> -	---help---
>>> +	bool "FLux Advanced Security Kernel support"
>>> +	default n
>>
>> I don't understand this change in default (and as an aside, a default
>> of "n" doesn't need spelling out): In the description you say "adjusted
>> CONFIG_XSM_SILO, CONFIG_XSM_FLASK, and the default module selection to
>> sensible defaults". If that's to describe this change, then I'm afraid
>> I don't see why defaulting to "n" is more sensible once the person
>> configuring Xen has chosen the configure XSM's (or XSM_CONFIGURABLE's)
>> sub-options. If that's unrelated to the change here, then I'm afraid
>> I'm missing justification altogether. (Same for SILO then.)
> 
> When an individual selects to be able to be to configure/select
> alternative policy modules, they should be the ones to decide which
> one(s) should be enabled and not have presumptuous selections provided
> to them. IOW, the sensible default is to have no modules selected and
> allow the user to enable the one(s) they want.

Just FTR - I disagree. Defaults should be such that a majority would
not need to alter the respective settings.

>>> @@ -282,7 +275,7 @@ endchoice
>>>  config LATE_HWDOM
>>>  	bool "Dedicated hardware domain"
>>>  	default n
>>> -	depends on XSM && X86
>>> +	depends on XSM_FLASK && X86
>>
>> This change is not mentioned or justified in the description. In fact
>> I think it is unrelated to the change here and hence would want breaking
>> out.
> 
> Actually, if you read the help just below it specifically says to use
> this feature requires having an XSM policy (legacy wording for XSM Flask
> policy) to be able to do the proper fine grained delegation of the
> permissions/accesses necessary for a hardware domain to work. This
> should have been made XSM_FLASK when that KConfig option was added.
> Dropping the XSM KConfig option just exposed this oversight. Ack that I
> should have mentioned this in the commit message.

I'm getting the impression that you mistook "breaking out" for "dropping".
I can see the point of the change; it merely shouldn't be hidden in this
otherwise unrelated much larger change.

>>> -static inline int xsm_set_target (xsm_default_t def, struct domain *d, struct domain *e)
>>> +static inline int xsm_set_target(xsm_default_t action, struct domain *d,
>>> +                                 struct domain *e)
>>>  {
>>> -    return alternative_call(xsm_ops.set_target, d, e);
>>> +    if ( xsm_ops.set_target )
>>> +        return alternative_call(xsm_ops.set_target, d, e);
>>> +
>>> +    XSM_ASSERT_ACTION(XSM_HOOK);
>>> +    return xsm_default_action(action, current->domain, NULL);
>>>  }
>>
>> While benign because xsm_default_action() does nothing for XSM_HOOK, I
>> think there's an inconsistency here which rather wants correcting (in
>> a prereq patch): The default hook should have been passed consistent
>> arguments, no matter whether used because of !XSM or because of the
>> module in use left the hook unset.
>>
>> Of course such anomalies are much easier to notice (outside of review
>> of patches introducing such) with you now placing both invocations
>> next to each other.
> 
> This series assumes the logic is correct and is only focused on trying
> to make XSM more maintainable. I would be glad to consider looking at
> what the right security decisions should be in a subsequent patch set
> but will be consider out of scope for this patch set.

Well, I came to make these comments because these anomalies look to
stand in the way of producing a sufficiently small set of wrapper /
helper macros. But since you want to go back to an older version's
approach, the need to correct these as a (series of) prereq(s) may
indeed vanish.

Jan



      reply	other threads:[~2021-08-30 13:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 14:06 [PATCH v3 0/7] xsm: refactoring xsm hooks Daniel P. Smith
2021-08-05 14:06 ` [PATCH v3 1/7] xen: Implement xen/alternative-call.h for use in common code Daniel P. Smith
2021-08-05 15:31   ` Jan Beulich
2021-08-05 14:06 ` [PATCH v3 2/7] xsm: remove the ability to disable flask Daniel P. Smith
2021-08-25 15:22   ` Jan Beulich
2021-08-27 13:42     ` Daniel P. Smith
2021-08-05 14:06 ` [PATCH v3 3/7] xsm: refactor xsm_ops handling Daniel P. Smith
2021-08-25 15:16   ` Jan Beulich
2021-08-27 13:44     ` Daniel P. Smith
2021-08-05 14:06 ` [PATCH v3 4/7] xsm: convert xsm_ops hook calls to alternative call Daniel P. Smith
2021-08-05 14:06 ` [PATCH v3 5/7] xsm: decouple xsm header inclusion selection Daniel P. Smith
2021-08-26  8:13   ` Jan Beulich
2021-08-27 14:06     ` Daniel P. Smith
2021-08-30 13:24       ` Jan Beulich
2021-08-30 13:41         ` Daniel P. Smith
2021-08-30 13:46           ` Jan Beulich
2021-08-30 13:55             ` Daniel P. Smith
2021-08-05 14:06 ` [PATCH v3 6/7] xsm: drop generic event channel labeling exclusion Daniel P. Smith
2021-08-25 15:44   ` Jan Beulich
2021-08-27 14:16     ` Daniel P. Smith
2021-08-30 13:25       ` Jan Beulich
2021-08-05 14:06 ` [PATCH v3 7/7] xsm: removing facade that XSM can be enabled/disabled Daniel P. Smith
2021-08-26  9:37   ` Jan Beulich
2021-08-30 12:11     ` Daniel P. Smith
2021-08-30 13:34       ` Jan Beulich [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=fb8bc2d1-caa1-3cbf-0796-5578faec41bd@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dpsmith@apertussolutions.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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.