All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Mark Williamson <maw48@hermes.cam.ac.uk>
Cc: xen-devel@lists.sourceforge.net, SE-Linux <selinux@tycho.nsa.gov>
Subject: Re: [Xen-devel] protecting xen startup
Date: Wed, 24 Nov 2004 00:18:47 +0000	[thread overview]
Message-ID: <20041124001847.GH5146@lkcl.net> (raw)
In-Reply-To: <Pine.LNX.4.60.0411232242120.3871@hermes-1.csi.cam.ac.uk>

On Tue, Nov 23, 2004 at 10:49:24PM +0000, Mark Williamson wrote:
> >is there anything preventing that interface from being removed, such
> >that the client/server bit is munged into a single application?
> 
> In older releases, there wasn't a Xend.  Instead we had a set of 
> management scripts that called various operations directly.  You could in 
> principle munge xm and xend together into a big megatool but it wouldn't 
> be pretty.

 i'll take that as a challenge, then :)

> Xend makes concurrency control much easier, provides a central point of 
> contact regarding machine state and demuxes the virtual consoles of the 
> domain.  You'd have to address these problems in addition to combining the 
> tools, which would take a fair bit of hacking to do properly.

 okay.

 assuming that 1) i don't want a central point of contact i only want
 _one_ point of contact and 2) i can live without virtual consoles
 until i understand the code enough and can get away with
 using ssh logins instead:

 would this be a simple enough task for someone not entirely
 familiar with xen's code [but who has developed a number of
 20k+ line python projects over the past four years]?



> >>Not exactly.  At the Linux Level, there aren't any extra Xen system calls.
> >>Most commands are issued to Xen by performing ioctls on the
> >>/proc/xen/privcmd file.
> >
> >GREAT.
> >
> >that means that it will be possible to lock down at the very least the
> >access to /proc/xen and later, should it prove worthwhile, to protect
> >each ioctl with a new selinux security id per ioctl command.
> 
> Right now, only root (actually, probably users with the CAP_SYSADMIN 
> capability or similar) can do operations on /proc/xen.  

 [which, please excuse me for saying so, doesn't exactly help if that
 root-only interface is then exposed via an open high port number!! :) ]

> Also, many Xen 
> operations are mapped onto one ioctl call so as it is you can't do very 
> fine grained protection based on ioctl number.  

 i was thinking of adding in an LSM hook function that received the
 ioctl number as one of its arguments, translated that in a case
 statement into the corresponding selinux SIDs, and from there checked
 an selinux permission - in a similar way that security/selinux/hooks.c's
 selinux_file_ioctl() or the selinux_file_fcntl() function operates.

 i.e. not using file_has_perm() but task_has_perm() instead.

 then the first thing that the xen ioctl function does is call that LSM
 hook function.

 it would therefore also be possible for someone else to write a
 corresponding LSM linux capabilities function call, too.  should
 someone so wish.

 l.

-- 
--
<a href="http://lkcl.net">http://lkcl.net</a>
--

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

WARNING: multiple messages have this Message-ID (diff)
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: Mark Williamson <maw48@hermes.cam.ac.uk>
Cc: xen-devel@lists.sf.net, SE-Linux <selinux@tycho.nsa.gov>
Subject: Re: protecting xen startup
Date: Wed, 24 Nov 2004 00:18:47 +0000	[thread overview]
Message-ID: <20041124001847.GH5146@lkcl.net> (raw)
In-Reply-To: <Pine.LNX.4.60.0411232242120.3871@hermes-1.csi.cam.ac.uk>

On Tue, Nov 23, 2004 at 10:49:24PM +0000, Mark Williamson wrote:
> >is there anything preventing that interface from being removed, such
> >that the client/server bit is munged into a single application?
> 
> In older releases, there wasn't a Xend.  Instead we had a set of 
> management scripts that called various operations directly.  You could in 
> principle munge xm and xend together into a big megatool but it wouldn't 
> be pretty.

 i'll take that as a challenge, then :)

> Xend makes concurrency control much easier, provides a central point of 
> contact regarding machine state and demuxes the virtual consoles of the 
> domain.  You'd have to address these problems in addition to combining the 
> tools, which would take a fair bit of hacking to do properly.

 okay.

 assuming that 1) i don't want a central point of contact i only want
 _one_ point of contact and 2) i can live without virtual consoles
 until i understand the code enough and can get away with
 using ssh logins instead:

 would this be a simple enough task for someone not entirely
 familiar with xen's code [but who has developed a number of
 20k+ line python projects over the past four years]?



> >>Not exactly.  At the Linux Level, there aren't any extra Xen system calls.
> >>Most commands are issued to Xen by performing ioctls on the
> >>/proc/xen/privcmd file.
> >
> >GREAT.
> >
> >that means that it will be possible to lock down at the very least the
> >access to /proc/xen and later, should it prove worthwhile, to protect
> >each ioctl with a new selinux security id per ioctl command.
> 
> Right now, only root (actually, probably users with the CAP_SYSADMIN 
> capability or similar) can do operations on /proc/xen.  

 [which, please excuse me for saying so, doesn't exactly help if that
 root-only interface is then exposed via an open high port number!! :) ]

> Also, many Xen 
> operations are mapped onto one ioctl call so as it is you can't do very 
> fine grained protection based on ioctl number.  

 i was thinking of adding in an LSM hook function that received the
 ioctl number as one of its arguments, translated that in a case
 statement into the corresponding selinux SIDs, and from there checked
 an selinux permission - in a similar way that security/selinux/hooks.c's
 selinux_file_ioctl() or the selinux_file_fcntl() function operates.

 i.e. not using file_has_perm() but task_has_perm() instead.

 then the first thing that the xen ioctl function does is call that LSM
 hook function.

 it would therefore also be possible for someone else to write a
 corresponding LSM linux capabilities function call, too.  should
 someone so wish.

 l.

-- 
--
<a href="http://lkcl.net">http://lkcl.net</a>
--


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

  reply	other threads:[~2004-11-24  0:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-23 17:05 protecting xen startup Luke Kenneth Casson Leighton
2004-11-23 18:07 ` Mike Wray
2004-11-23 21:03   ` Luke Kenneth Casson Leighton
2004-11-23 18:07 ` Mark Williamson
2004-11-23 20:51   ` Luke Kenneth Casson Leighton
2004-11-23 21:03     ` Ian Pratt
2004-11-23 21:52       ` Luke Kenneth Casson Leighton
2004-11-23 22:00         ` Jan Kundrát
2004-11-24  0:21           ` Luke Kenneth Casson Leighton
2004-11-24  8:17             ` Mark Williamson
2004-11-24 10:39               ` Luke Kenneth Casson Leighton
2004-11-23 22:49     ` Mark Williamson
2004-11-24  0:18       ` Luke Kenneth Casson Leighton [this message]
2004-11-24  0:18         ` Luke Kenneth Casson Leighton
2004-11-24  8:27         ` Mark Williamson
  -- strict thread matches above, loose matches on Subject: below --
2004-11-24 11:48 Neugebauer, Rolf
2004-11-24 15:24 ` [Xen-devel] " Luke Kenneth Casson Leighton
2004-11-24 20:24   ` Luke Kenneth Casson Leighton

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=20041124001847.GH5146@lkcl.net \
    --to=lkcl@lkcl.net \
    --cc=maw48@hermes.cam.ac.uk \
    --cc=selinux@tycho.nsa.gov \
    --cc=xen-devel@lists.sourceforge.net \
    /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.