Skip to contentSkip to conversation

Xenomai: binding failed: Operation not permitted.

Xenomai-help Petr Cervenka 3 participants 7 messages May 19, 2006 – Jun 9, 2006 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi,
When I try to run realtime application under lesser than root rights, I get this strange error:
Xenomai: binding failed: Operation not permitted.

Error showed after kernel update 2.6.15.6 -> 2.6.16.16 and xenomai update 2.1.1 -> daily snapshot (2006/05/18) Changing of the rights of the /dev/rt* dousn't help.

Any suggestions?

Petr Cervenka

#3 lore raw
Quoted 9 lines · Petr Cervenka

Hi,
When I try to run realtime application under lesser than root rights, I get this strange error:
Xenomai: binding failed: Operation not permitted.

Error showed after kernel update 2.6.15.6 -> 2.6.16.16 and xenomai update 2.1.1 -> daily snapshot (2006/05/18) Changing of the rights of the /dev/rt* dousn't help.

Any suggestions?

That's intended. Real-time means real power, so all skin syscalls now require root privileges (more precisely CAP_SYS_NICE). This can be switched off, but standard syscalls like mlockall may still demand root power (mlock'ing is at least size-limited for normal users on recent kernels). And with current real-time APIs, it makes no sense anyway to restrict the real-time user's permission by turning his account into a non-root one.

Jan

#4 lore raw

Hi,

Okay, but in this case, why do we need root permissions for programs accessing that "only" access shared memory area (heaps)????

Best Regards
Steph

Jan Kiszka wrote

Quoted 35 lines
Quoted 11 lines · Petr Cervenka

Hi,
When I try to run realtime application under lesser than root rights, I get this strange error:
Xenomai: binding failed: Operation not permitted.

Error showed after kernel update 2.6.15.6 -> 2.6.16.16 and xenomai update 2.1.1 -> daily snapshot (2006/05/18) Changing of the rights of the /dev/rt* dousn't help.

Any suggestions?

That's intended. Real-time means real power, so all skin syscalls now require root privileges (more precisely CAP_SYS_NICE). This can be switched off, but standard syscalls like mlockall may still demand root power (mlock'ing is at least size-limited for normal users on recent kernels). And with current real-time APIs, it makes no sense anyway to restrict the real-time user's permission by turning his account into a non-root one.

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

#5 lore raw
Quoted 4 lines · s.a.

Hi,

Okay, but in this case, why do we need root permissions for programs accessing that "only" access shared memory area (heaps)????

For simplicity reasons: we did not sort out at this stage which service might be harmless and which not (or less), we only added access control to all Xenomai syscalls. Again, you can switch the whole checking off during compile time, but this, of course, opens the door completely. Given your system is adequately secured against illicit logins, this can be a pragmatic solution.

Ok, we might derive access control to the heap from the permissions a process has on /dev/rtheap. But is this an urging need to have security for all Xenomai services but heaps? Opening heaps would make access control more complicated without a clear security model behind it. But I'm always open to concrete user requirements!

Jan

Quoted 42 lines

Best Regards
Steph

Jan Kiszka wrote

Quoted 34 lines
Quoted 11 lines · Petr Cervenka

Hi,
When I try to run realtime application under lesser than root rights, I get this strange error:
Xenomai: binding failed: Operation not permitted.

Error showed after kernel update 2.6.15.6 -> 2.6.16.16 and xenomai update 2.1.1 -> daily snapshot (2006/05/18) Changing of the rights of the /dev/rt* dousn't help.

Any suggestions?

That's intended. Real-time means real power, so all skin syscalls now require root privileges (more precisely CAP_SYS_NICE). This can be switched off, but standard syscalls like mlockall may still demand root power (mlock'ing is at least size-limited for normal users on recent kernels). And with current real-time APIs, it makes no sense anyway to restrict the real-time user's permission by turning his account into a non-root one.

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

#6 lore raw

Hi,

In my mind , one or more rt process manages everything critical, need root access for resources reasons , other processes are things like gui to interact with realtime world, including X11 applications (I know , I will hurt some people, but this is the truth : X11 !) .....

Best Regards
Steph

Quoted 87 lines · Jan Kiszka
Quoted 6 lines · s.a.

Hi,

Okay, but in this case, why do we need root permissions for programs accessing that "only" access shared memory area (heaps)????

For simplicity reasons: we did not sort out at this stage which service might be harmless and which not (or less), we only added access control to all Xenomai syscalls. Again, you can switch the whole checking off during compile time, but this, of course, opens the door completely. Given your system is adequately secured against illicit logins, this can be a pragmatic solution.

Ok, we might derive access control to the heap from the permissions a process has on /dev/rtheap. But is this an urging need to have security for all Xenomai services but heaps? Opening heaps would make access control more complicated without a clear security model behind it. But I'm always open to concrete user requirements!

Jan

Quoted 4 lines

Best Regards
Steph

Quoted 44 lines

Jan Kiszka wrote

Quoted 40 lines
Quoted 4 lines · Petr Cervenka

Hi,
When I try to run realtime application under lesser than root rights, I get this strange error:
Xenomai: binding failed: Operation not permitted.

Quoted 9 lines

Error showed after kernel update 2.6.15.6 -> 2.6.16.16 and xenomai update 2.1.1 -> daily snapshot (2006/05/18) Changing of the rights of the /dev/rt* dousn't help.

Any suggestions?

That's intended. Real-time means real power, so all skin syscalls now require root privileges (more precisely CAP_SYS_NICE). This can be switched off, but standard syscalls like mlockall may still demand root power (mlock'ing is at least size-limited for normal users on recent kernels). And with current real-time APIs, it makes no sense anyway to restrict the real-time user's permission by turning his account into a non-root one.

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

#7 lore raw
Quoted 7 lines · s.a.

Hi,

In my mind , one or more rt process manages everything critical, need root access for resources reasons , other processes are things like gui to interact with realtime world, including X11 applications (I know , I will hurt some people, but this is the truth : X11 !) .....

My point is: what do you gain by separating the RT core from the logging or gui application? Not much as long as the interface is not robust. This means that your uncritical part must not be able to interfere with the critical one, e.g. by acquiring some common lock or messing up a shared memory which is used blindly by the RT code. If your application design can guarantee this, ok.

But then note that Xenomai heaps are unsuited for being shared with not fully trusted parties: management structures reside next to the data, write permission is always acquired (and is required for allocation/release operations), access control beyond go/no-go is not supported. Better use "standard" (Linux) shared memory for this: Invoke shm_open("myshm", ...), adapt the access rights of the newly created /dev/shm/myshm, and let the unprivileged process attach to it.

Jan

#8 lore raw
Quoted 16 lines · Jan Kiszka
Quoted 7 lines · s.a.

Hi,

In my mind , one or more rt process manages everything critical, need root access for resources reasons , other processes are things like gui to interact with realtime world, including X11 applications (I know , I will hurt some people, but this is the truth : X11 !) .....

My point is: what do you gain by separating the RT core from the logging or gui application? Not much as long as the interface is not robust. This means that your uncritical part must not be able to interfere with the critical one, e.g. by acquiring some common lock or messing up a shared memory which is used blindly by the RT code. If your application design can guarantee this, ok.

Quoted 8 lines

But then note that Xenomai heaps are unsuited for being shared with not fully trusted parties: management structures reside next to the data, write permission is always acquired (and is required for allocation/release operations), access control beyond go/no-go is not supported. Better use "standard" (Linux) shared memory for this: Invoke shm_open("myshm", ...), adapt the access rights of the newly created /dev/shm/myshm, and let the unprivileged process attach to it.

I haven't looked at this module so far in details, but from the first quick glance I just took it looks like a simple way to open realtime access to specific groups:

http://sourceforge.net/projects/realtime-lsm/

This still provides no privilege separation with respect to realtime (note the comments in the README), but it doesn't enforce you to run all RT-apps under root. So you keep at least the file system secure...

Given that this module plays with capabilities, it should work fine with Xenomai as well (untested...).

Jan