All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xin Li (Talons)" <xin.li@citrix.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	Xin Li <talons.lee@gmail.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>, "Tim (Xen.org)" <tim@xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	Jan Beulich <JBeulich@suse.com>, Ming Lu <ming.lu@citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm
Date: Mon, 2 Jul 2018 07:21:47 +0000	[thread overview]
Message-ID: <626853be1c4344f6a10ff60433725147@SINPEX02CL01.citrite.net> (raw)
In-Reply-To: <03f7c8f0-b129-d787-5716-4efbc10100af@citrix.com>

Hell Andrew,

> -----Original Message-----
> From: Andrew Cooper
> Sent: Friday, June 29, 2018 5:48 PM
> To: Xin Li <talons.lee@gmail.com>; xen-devel@lists.xen.org
> Cc: Xin Li (Talons) <xin.li@citrix.com>; Daniel De Graaf
> <dgdegra@tycho.nsa.gov>; George Dunlap <George.Dunlap@citrix.com>; Jan
> Beulich <JBeulich@suse.com>; Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com>; Stefano Stabellini <sstabellini@kernel.org>; Tim
> (Xen.org) <tim@xen.org>; Wei Liu <wei.liu2@citrix.com>; Sergey Dyasli
> <sergey.dyasli@citrix.com>; Ming Lu <ming.lu@citrix.com>
> Subject: Re: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm
> 
> On 29/06/18 10:28, Xin Li wrote:
> > Introduce new boot parameter xsm to choose which xsm module is
> > enabled, and set default to dummy.
> >
> > Signed-off-by: Xin Li <xin.li@citrix.com>
> 
> As a note for other reviewers, this series is based on top of my XSM Kconfig
> cleanup.
> 
> As for this patch, its almost there.  Just a few minor issues.
> 
> >
> > ---
> > CC: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> > CC: George Dunlap <George.Dunlap@eu.citrix.com>
> > CC: Jan Beulich <JBeulich@suse.com>
> > CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > CC: Stefano Stabellini <sstabellini@kernel.org>
> > CC: Tim Deegan <tim@xen.org>
> > CC: Wei Liu <wei.liu2@citrix.com>
> > CC: Sergey Dyasli <sergey.dyasli@citrix.com>
> > CC: Andrew Cooper <andrew.cooper3@citrix.com>
> > CC: Ming Lu <ming.lu@citrix.com>
> > ---
> >  docs/misc/xen-command-line.markdown | 13 ++++++++++
> >  xen/xsm/xsm_core.c                  | 39 ++++++++++++++++++++++++++++-
> >  2 files changed, 51 insertions(+), 1 deletion(-)
> >
> > diff --git a/docs/misc/xen-command-line.markdown
> > b/docs/misc/xen-command-line.markdown
> > index 075e5ea159..7c689b8225 100644
> > --- a/docs/misc/xen-command-line.markdown
> > +++ b/docs/misc/xen-command-line.markdown
> > @@ -865,6 +865,19 @@ hardware domain is architecture dependent.
> >  Note that specifying zero as domU value means zero, while for dom0 it
> > means  to use the default.
> >
> > +### xsm
> > +> `= dummy | silo | flask`
> 
> This should be just "dummy | flask" in this patch, and extended with silo in the
> next path.  Also, options in this file should be sorted alphabetically, so ### xsm
> should be near the end, rather than beside flask.

Right. Done.

> 
> > +
> > +> Default: `dummy`
> > +
> > +Specify which XSM module should be enabled.  This option is only
> > +available if the hypervisor was compiled with XSM support.
> > +
> > +* `dummy`: this is the default choice.  No special restriction will be applied.
> > +  it's also used when XSM is compiled out.
> > +* `flask`: this is the policy based access control.  To choose this,
> > +the
> > +  separated option in kconfig must also be enabled.
> > +
> >  ### flask
> >  > `= permissive | enforcing | late | disabled`
> >
> > diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index
> > cddcf7aa51..e002200578 100644
> > --- a/xen/xsm/xsm_core.c
> > +++ b/xen/xsm/xsm_core.c
> > @@ -31,6 +31,30 @@
> >
> >  struct xsm_operations *xsm_ops;
> >
> > +enum xsm_bootparam {
> > +    XSM_BOOTPARAM_DUMMY,
> > +    XSM_BOOTPARAM_FLASK,
> > +    XSM_BOOTPARAM_INVALID,
> 
> I'd drop INVALID (See below for the parsing aspect), as it actually falls back to
> DUMMY.
> 
> > +};
> > +
> > +enum xsm_bootparam __read_mostly xsm_bootparam =
> XSM_BOOTPARAM_DUMMY;
> 
> This should be __initdata rather than __read_mostly.  It is safe to be discarded
> after boot.
> 
> > +
> > +static int __init parse_xsm_param(const char *s) {
> 
> int rc = 0;
> 
> > +    if ( !strcmp(s, "dummy") )
> > +        xsm_bootparam = XSM_BOOTPARAM_DUMMY; #ifdef
> CONFIG_XSM_FLASK
> > +    else if ( !strcmp(s, "flask") )
> > +        xsm_bootparam = XSM_BOOTPARAM_FLASK; #endif
> > +    else
> > +        xsm_bootparam = XSM_BOOTPARAM_INVALID;
> > +
> > +    return 0;
> 
> else
>     rc = -EINVAL;
> 
> return rc;
> 
> As a result, the core command line infrastructure will inform the user if they
> passed an unrecognised option.
> 
OK. Thank you.

> ~Andrew
> 
> > +}
> > +
> > +custom_param("xsm", parse_xsm_param);
> > +
> >  static inline int verify(struct xsm_operations *ops)  {
> >      /* verify the security_operations structure exists */ @@ -57,7
> > +81,20 @@ static int __init xsm_core_init(const void *policy_buffer, size_t
> policy_size)
> >      }
> >
> >      xsm_ops = &dummy_xsm_ops;
> > -    flask_init(policy_buffer, policy_size);
> > +
> > +    switch ( xsm_bootparam )
> > +    {
> > +    case XSM_BOOTPARAM_DUMMY:
> > +        /* empty */
> > +        break;
> > +
> > +    case XSM_BOOTPARAM_FLASK:
> > +        flask_init(policy_buffer, policy_size);
> > +        break;
> > +
> > +    default:
> > +        printk("XSM: Invalid value for xsm= boot parameter.\n");
> > +    }
> >
> >      return 0;
> >  }



Best regards

Xin(Talons) Li
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-07-02  7:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29  9:28 [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm Xin Li
2018-06-29  9:28 ` [PATCH 2/2] xen/xsm: Add new SILO mode for XSM Xin Li
2018-06-29  9:51   ` Andrew Cooper
2018-07-02  6:42     ` Xin Li (Talons)
2018-06-29 10:36   ` Jan Beulich
2018-07-02  6:57     ` Xin Li (Talons)
2018-07-02  7:28       ` Jan Beulich
2018-07-02  9:22         ` Xin Li (Talons)
2018-07-02  9:38           ` Jan Beulich
2018-07-23 10:45             ` Xin Li (Talons)
2018-07-24  7:49               ` Jan Beulich
2018-07-24  8:18             ` Xin Li (Talons)
2018-08-17 19:25               ` Daniel De Graaf
2018-06-29 13:21   ` Julien Grall
2018-07-02  6:41     ` Xin Li (Talons)
2018-06-29  9:47 ` [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm Andrew Cooper
2018-06-29 10:04   ` Jan Beulich
2018-07-02  7:34     ` Xin Li (Talons)
2018-07-02  8:24       ` Jan Beulich
2018-07-02  8:39         ` Xin Li (Talons)
2018-07-02  9:04           ` Jan Beulich
2018-07-02  7:21   ` Xin Li (Talons) [this message]
2018-07-03  1:26 Xin Li
2018-07-03  6:10 ` Xin Li (Talons)
2018-07-03  7:12 ` Jan Beulich
2018-07-03  8:58   ` Xin Li (Talons)
2018-07-04 16:54   ` George Dunlap
2018-07-05  1:38     ` Xin Li (Talons)
2018-08-17 19:11 ` Daniel De Graaf
2018-09-28  8:18 Xin Li
2018-09-28 17:15 ` Daniel De Graaf
2018-09-29  9:22 Xin Li
2018-10-02  9:11 ` Jan Beulich
2018-10-08  6:30   ` Xin Li (Talons)

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=626853be1c4344f6a10ff60433725147@SINPEX02CL01.citrite.net \
    --to=xin.li@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ming.lu@citrix.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=talons.lee@gmail.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.