All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Group-based RT caps
Date: Thu, 28 Jun 2007 19:33:24 +0200	[thread overview]
Message-ID: <4683F0E4.2060801@domain.hid> (raw)
In-Reply-To: <18051.37616.432109.725998@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2725 bytes --]

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>  > Jan Kiszka wrote:
>  > > Fillod Stephane wrote:
>  > >> ...
>  > >> I think Johan was not asking to disable the mlockall, but to allow some.
>  > >> non-root user to be able to do it. He found his solution anyway, which
>  > >> is worth an entry in the FAQ.
>  > >>
>  > >> Since it is going to be a FAQ for those people in embedded business,
>  > >> some
>  > >> tricks to allow non-root operation of mlockall, SCHED_FIFO, etc., would
>  > >> be 
>  > >> useful. For example, you may hack the commoncap in linux/security/, 
>  > >> or a better solution would be to rely on realtime-lsm[1][2], thanks to 
>  > >> the audio folks.
>  > >>
>  > >> [1] http://sourceforge.net/projects/realtime-lsm/
>  > >> [2] http://lwn.net/Articles/110346/
>  > >>
>  > > 
>  > > I think we could and should incorporate such a feature into the nucleus.
>  > > 
>  > > There is already code in xnshadow_map playing with cap_effective, but
>  > > that happens too late. Instead, we should establish a group-based access
>  > > control just like rt-lsm (the other knobs of that module are either
>  > > irrelevant for Xenomai (mlock=0) or broken security-wise (any=1)) and
>  > > raise the required caps for a process that belongs to the specified
>  > > group, likely when an Xenomai interface gets attached by that process.
>  > > 
>  > > Comments? Volunteer coders...?
>  > 
>  > I couldn't resist, the approach looked too simple and appealing:
>  > 
>  > http://www.rts.uni-hannover.de/rtaddon/patches/xenomai/rt-caps-group.patch
>  > 
>  > Actually, it's even more advanced than realtime-lsm in so far as it also
>  > checks for secondary group membership. You can use the nucleus module
>  > parameter "xenomai_gid" to control the Xenomai group, also during
>  > runtime using /sys.
>  > 
>  > Works nicely for me. I'm able to run testsuite programs under my user
>  > account that now additionally belongs to the "xenomai" group. :)
>  > 
>  > One issue popped up and costed some nerves: linuxthreads-based
>  > pthread_create() (non-NPTL glibc, uClibc) with SCHED_FIFO/RR attribute
>  > fails already in userland because that library overeagerly checks for
>  > root permissions. This is now worked around, but maybe not in the
>  > cleanest way as it changes the initial thread scheduling order (more
>  > problematic for the POSIX skin than for Native).
> 
> no problem with the posix skin: the scheduling order is enforced by the
> use of a semaphore.
> 

OK, that's good.

So if this patch might be worth merging, can we push the Linux scheduler
adjustments for all skins into the trampoline epilogue? Philippe?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2007-06-28 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-26  8:53 [Xenomai-help] Xenomai and mlockall Fillod Stephane
2007-06-26  9:21 ` [Xenomai-core] Group-based RT caps (was: [Xenomai-help] Xenomai and mlockall) Jan Kiszka
2007-06-26  9:30   ` [Xenomai-core] [Xenomai-help] Group-based RT caps Jan Kiszka
2007-06-28 10:25   ` [Xenomai-core] " Jan Kiszka
2007-06-28 10:52     ` Gilles Chanteperdrix
2007-06-28 17:33       ` Jan Kiszka [this message]
2007-06-29  8:04     ` Johan Borkhuis
2007-06-29  8:11       ` Jan Kiszka
2007-06-29  8:15         ` Jan Kiszka
2007-06-29  8:41           ` Johan Borkhuis

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=4683F0E4.2060801@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.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.