All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Lars Rasmusson <lra@sics.se>, "Tim (Xen.org)" <tim@xen.org>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xsm_remove_from_physmap is (so far) only defined for X86 architecture, not for ARM
Date: Thu, 17 Jan 2013 12:13:50 -0500	[thread overview]
Message-ID: <50F8314E.3060002@tycho.nsa.gov> (raw)
In-Reply-To: <1358442302.13856.98.camel@zakaz.uk.xensource.com>

On 01/17/2013 12:05 PM, Ian Campbell wrote:
> On Tue, 2013-01-15 at 14:35 +0000, Daniel De Graaf wrote:
>> The rest of the changes look correct. The #ifdefs are a bit ugly, but
>> refactoring the MSI code into an arch-specific function should fix
>> that. 
> 
> I've just sent out a new patch which takes are of only the build failure
> on ARM with XSM disabled.
> 
> For fixing the flask build on ARM: what does security_device_sid return?
> If I want to refactor this:
>         #ifdef CONFIG_X86
>             if ( desc->msi_desc ) {
>                 struct pci_dev *dev = desc->msi_desc->dev;
>                 u32 sbdf = (dev->seg << 16) | (dev->bus << 8) | dev->devfn;
>                 if (ad) {
>                     AVC_AUDIT_DATA_INIT(ad, DEV);
>                     ad->device = sbdf;
>                 }
>                 return security_device_sid(sbdf, sid);
>             }
>         #endif
> into an arch specific function I need to be able to return something in
> the !desc->msi_desc case. Can a sid be any integer or could I return
> e.g. 0 in this case?
> 
> Ian.
> 

There are some reserved sids that might be useful here (SECINITSID_UNLABELED
if this case shouldn't be encountered). Zero might be the most suitable value,
since zero is not a valid sid and can be used to indicate "unable to resolve".
Zero will be treated as the unlabeled SID if passed to avc_has_perm.

security_device_sid returns either SECINITSID_DEVICE or the assigned SID of
the requested PCI device (as indexed by its sbdf number, and set either in
XSM policy or by flask-label-pci).

-- 
Daniel De Graaf
National Security Agency

      reply	other threads:[~2013-01-17 17:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 13:32 [PATCH] xsm_remove_from_physmap is (so far) only defined for X86 architecture, not for ARM lra
2013-01-11 13:40 ` Ian Campbell
2013-01-11 13:47 ` Keir Fraser
2013-01-11 16:24   ` Lars Rasmusson
2013-01-11 16:36     ` Keir Fraser
2013-01-11 16:46       ` Ian Campbell
2013-01-11 17:37         ` Daniel De Graaf
2013-01-15 11:18           ` Ian Campbell
2013-01-15 11:52             ` Stefano Stabellini
2013-01-15 13:42               ` Ian Campbell
2013-01-15 14:35             ` Daniel De Graaf
2013-01-17 17:05               ` Ian Campbell
2013-01-17 17:13                 ` Daniel De Graaf [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=50F8314E.3060002@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=lra@sics.se \
    --cc=tim@xen.org \
    --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.