<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 7, 2014 at 3:51 PM, Lukasz Pawelczyk <span dir="ltr"><<a href="mailto:havner@gmail.com" target="_blank">havner@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
On 7 Mar 2014, at 20:24, Lennart Poettering <<a href="mailto:mzerqung@0pointer.de">mzerqung@0pointer.de</a>> wrote:<br>
<br>
> On Fri, 07.03.14 19:45, Lukasz Pawelczyk (<a href="mailto:havner@gmail.com">havner@gmail.com</a>) wrote:<br>
><br>
>> Problem:<br>
>> Has anyone thought about a mechanism to limit/remove an access to a<br>
>> device during an application runtime? Meaning we have an application<br>
>> that has an open file descriptor to some /dev/node and depending on<br>
>> *something* it gains or looses the access to it gracefully (with or<br>
>> without a notification, but without any fatal consequences).<br>
><br>
> logind can mute input devices as sessions are switched, to enable<br>
> unpriviliged X11 and wayland compositors.<br>
<br>
</div>Would you please elaborate on this? Where is this mechanism? How does it work without kernel space support? Is there some kernel space support I’m not aware of?<br>
<div class=""><br>
>> Example:<br>
>> LXC. Imagine we have 2 separate containers. Both running full operating<br>
>> systems. Specifically with 2 X servers. Both running concurrently of<br>
><br>
> Well, devices are not namespaced on Linux (with the single exception of<br>
> network devices). An X server needs device access, hence this doesn't<br>
> fly at all.<br>
><br>
> When you enumerate devices with libudev in a container they will never<br>
> be marked as "initialized" and you do not get any udev hotplug events in<br>
> containers, and you don#t have the host's udev db around, nor would it<br>
> make any sense to you if you had. X11 and friends rely on udev<br>
> however...<br>
><br>
> Before you think about doing something like this, you need to fix the<br>
> kernel to provide namespaced devices (good luck!)<br>
<br>
</div>Precisly! That’s the generic idea. I’m not for implementing it though at this moment. I just wanted to know whether anybody actually though about it or maybe someone is interested in starting such a work, etc.<br></blockquote>
<div><br></div><div>Yes, we have started such a thing. Here is the link to the wiki:</div><div><a href="https://github.com/Cellrox/devns-patches/wiki">https://github.com/Cellrox/devns-patches/wiki</a></div><div><br></div>
<div>[...]</div><div><br></div><div>Oren.</div><div><br></div></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important">
<div dir="ltr" style="display:inline!important"><div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">
<div dir="ltr"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"><div dir="ltr" style="display:inline!important"></div></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>