[linux-audio-dev] Linux Security Module for realtime audio

torbenh at gmx.de torbenh at gmx.de
Wed Dec 3 10:46:00 UTC 2003


On Tue, Dec 02, 2003 at 11:03:29AM -0600, Jack O'Quin wrote:
> torbenh at gmx.de writes:
> 
> > the most simple way would be parameters given to the module for the
> > realtime group and user. There are nice macros for module parameters.
> > 
> > i believe that adding to the currently overridden function
> > 
> > if( bprm->e_gid == realtime_gid ) {
> >   bprm->cap_effective = CAP_IPC_LOCK | CAP_SYS_NICE | CAP_SYS_RESORCE
> >   bprm->cap_permitted = CAP_IPC_LOCK | CAP_SYS_NICE | CAP_SYS_RESORCE
> > }
> > 
> > should work fine.
> 
> That's pretty much what I have in mind.  I'm still trying to figure
> out how to pass the group id as a parameter somewhere.  I wanted to
> use /proc/sys/kernel/realtime-group, but that seems to require
> patching the kernel.  It looks like the new sysfs is intended for this
> purpose.  I'll investigate.

there are functions to register inodes in proc.
but i dont consider this necessary. Why would i want to change the
realtime gid once the module is loaded ?

modprobe jackcapabilities rtgid=407

seems sufficient to me...
and this requires 2 lines of code... see attachement..


> 
> > although i am not happy with CAP_SYS_RESOURCE ( needed for RTC
> > interrupts > 64Hz ) which also allows a process to Override quota
> > limits.
> 
> Agreed.  This is sometimes needed but not always.  Maybe it should be
> a separate module to use as required.

considering the configurability of the max frequency fernando posted,
we need to investigate on mlockall now...

> 
> > But because in drivers/char/rtc.c the check is
> > if ( capable( CAP_SYS_RESOURCE ) ) { allow higher freq }
> > 
> > it seems like its not possible with the current implementation.
> > but we could however provide a jackrtc module which checks for a
> > new CAP_RTC_INTS. 
> 
> Can you add a new capability without patching the kernel?

definitely yes...
capable can be overridden in an LSM.
but we can still use the current implementation, because capable( i )
tests if bit i is set in the effective_caps.

the highest capability number is 28.. so we have 3 caps left.


-- 
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jackcaps-0.2.tar.gz
Type: application/x-tar-gz
Size: 4824 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20031203/b88ace66/attachment.bin>


More information about the Linux-audio-dev mailing list