Skip to contentSkip to conversation

Tmpfs acls

PATCH In review Andreas Gruenbacher 6 participants 8 messages Jan 8, 2006 – Jan 10, 2006

lore
Share & tools
lore
#0 lore raw

cover Tmpfs acls

This is an update of the tmpfs acl patches against 2.6.15-git4. (The first version of these patches was posted on 2 February 2005.) We'll have our /dev tree on tmpfs in the future, and we need acls there to manage device inode permissions of logged-in users. Other distributions will be in exactly the same situation, and need this patchset as well.

Andrew, if this stuff looks good enough to you, could you please let it live in -mm for some time?

Thanks,
Andreas

--
Andreas Gruenbacher <[email protected]>
SUSE Labs, SUSE LINUX Products GmbH / Novell Inc.

#1 lore raw
Quoted 5 lines · Andreas Gruenbacher

This is an update of the tmpfs acl patches against 2.6.15-git4. (The first version of these patches was posted on 2 February 2005.) We'll have our /dev tree on tmpfs in the future, and we need acls there to manage device inode permissions of logged-in users. Other distributions will be in exactly the same situation, and need this patchset as well.

Hmm. Do you have any infrastructure for revoking open file descriptors when a user logs out?

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
Quoted 9 lines · Matthew Garrett
Quoted 5 lines · Andreas Gruenbacher

This is an update of the tmpfs acl patches against 2.6.15-git4. (The first version of these patches was posted on 2 February 2005.) We'll have our /dev tree on tmpfs in the future, and we need acls there to manage device inode permissions of logged-in users. Other distributions will be in exactly the same situation, and need this patchset as well.

Hmm. Do you have any infrastructure for revoking open file descriptors when a user logs out?

Open file descriptors have nothing to do with it. The device permissions are set by different pam modules on different distributions (pam_console, pam_resmgr).

Without acls, permissions are assigned by changing file ownership. With acls, the respective user or users can be given access as appropriate, which is more flexible. There are a few cases in which it is desirable to grant access to a device to more than one locally logged in user. This also obsoletes the resmgr hack of passing around open file descriptors and several hacks in applications that use this mechanism, because permissions can be set as appropriate.

Andreas

#3 lore raw
Quoted 7 lines · Andreas Gruenbacher
Quoted 2 lines · Matthew Garrett

Hmm. Do you have any infrastructure for revoking open file descriptors when a user logs out?

Open file descriptors have nothing to do with it. The device permissions are set by different pam modules on different distributions (pam_console, pam_resmgr).

Right. But what stops a user writing an application that opens a device, hangs around after the user logs out and then provides access to the user when logged in remotely?

Handwavy problem scenario - user A logs in, is given access to the soundcard. Starts running a program that when given appropriate signals will record from the system microphone. Logs out. Waits for user B, who he suspects is having an affair with his wife, and then monitors any conversations that user B has. ACLs on their own don't seem to solve this any more than just statically assigning group membership to users.

Signature · 1 line
Matthew Garrett | [email protected]
#4 lore raw
Quoted 13 lines · Matthew Garrett
Quoted 7 lines · Andreas Gruenbacher
Quoted 2 lines · Matthew Garrett

Hmm. Do you have any infrastructure for revoking open file descriptors when a user logs out?

Open file descriptors have nothing to do with it. The device permissions are set by different pam modules on different distributions (pam_console, pam_resmgr).

Right. But what stops a user writing an application that opens a device, hangs around after the user logs out and then provides access to the user when logged in remotely?

Quoted 5 lines

Handwavy problem scenario - user A logs in, is given access to the soundcard. Starts running a program that when given appropriate signals will record from the system microphone. Logs out. Waits for user B, who he suspects is having an affair with his wife, and then monitors any conversations that user B has.

That can be solved in the user session handling and not in the kernel.

Quoted 2 lines

ACLs on their own don't seem to solve
this any more than just statically assigning group membership to users.

Sure, they do. Unlike silly group memberships, the system can provide ressources to "local" users only.

Kay

#5 lore raw
Quoted 8 lines · Kay Sievers
Quoted 5 lines · Matthew Garrett

Handwavy problem scenario - user A logs in, is given access to the soundcard. Starts running a program that when given appropriate signals will record from the system microphone. Logs out. Waits for user B, who he suspects is having an affair with his wife, and then monitors any conversations that user B has.

That can be solved in the user session handling and not in the kernel.

Without killing every application that they've been left running? How? The only way I can think of is by checking open files against a blacklist, which seems, uhm, fragile.

Signature · 1 line
Matthew Garrett | [email protected]
#6 lore raw
In reply to Kay Sievers
Quoted 4 lines · Kay Sievers
Quoted 2 lines

he suspects is having an affair with his wife, and then monitors any conversations that user B has.

That can be solved in the user session handling and not in the kernel.

Exactly how do you plan to do that ?

#7 lore raw
In reply to Matthew Garrett
Quoted 6 lines · Matthew Garrett

Handwavy problem scenario - user A logs in, is given access to the soundcard. Starts running a program that when given appropriate signals will record from the system microphone. Logs out. Waits for user B, who he suspects is having an affair with his wife, and then monitors any conversations that user B has. ACLs on their own don't seem to solve this any more than just statically assigning group membership to users.

This scenario is not a permission but a locking problem. User B should just claim the microphone exclusively and that should fail if user A keeps an fd open.

For the generic case maybe a new lock type would be useful, that would fail iff a process with a different effective UID keeps the device open.

Gabor

Signature · 4 lines
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------