Skip to contentSkip to conversation

udev: manage tmpfs files and directories

PATCH New Guido Trentalancia 4 participants 8 messages Dec 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

Update the udev module so that the udev domain can manage tmpfs files and directories.

---
 policy/modules/system/udev.te |    2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/udev.te +2 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 files_search_mnt(udev_t)
 
 fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 fs_list_inotifyfs(udev_t)
 fs_rw_anon_inodefs_files(udev_t)
 
#1 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

Hi,
on debian with systemd's udev these permissions are not needed, maybe you can put hem into a ifndef(`init_systemd',...) block?

Kindly Regards,
Christian G?ttsche

2016-12-18 19:13 GMT+01:00 Guido Trentalancia via refpolicy <[email protected]>:

Quoted 23 lines

Update the udev module so that the udev domain can manage tmpfs files and directories.

---
 policy/modules/system/udev.te |    2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/udev.te 2016-12-18 18:09:55.935617782 +0100 renamed from policy/modules/system/udev.te 2016-09-10 18:09:13.359710389 +0200 +2 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 files_search_mnt(udev_t)
 
 fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 fs_list_inotifyfs(udev_t)
 fs_rw_anon_inodefs_files(udev_t)
 

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

#2 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

Hello.

Quoted 3 lines · cgzones

Hi,
on debian with systemd's udev these permissions are not needed, maybe you can put hem into a ifndef(`init_systemd',...) block?

Yes, thanks very much for telling me, it's a good idea !

I'll post a new revised patch shortly...

Quoted 22 lines

Kindly Regards,
?Christian G?ttsche

2016-12-18 19:13 GMT+01:00 Guido Trentalancia via refpolicy <[email protected]>:

Quoted 17 lines

Update the udev module so that the udev domain can manage tmpfs files
and directories.

---
?policy/modules/system/udev.te |????2 ++
?1 file changed, 2 insertions(+)

--- a/policy/modules/system/udev.te?????2016-09-10 18:09:13.359710389 +0200
+++ b/policy/modules/system/udev.te?????2016-12-18 18:09:55.935617782 +0100

(quoted diff) +0 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 ?files_search_mnt(udev_t)
 
Quoted 5 lines

Review files_getattr_generic_locks(udev_t) · line 132

Quoted 5 lines
(quoted diff) +2 -0
 ?fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 ?fs_list_inotifyfs(udev_t)
 ?fs_rw_anon_inodefs_files(udev_t)

Regards,

Guido

#3 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

In reply to cgzones
Quoted 4 lines · cgzones via refpolicy

Hi,
on debian with systemd's udev these permissions are not needed, maybe you can put hem into a ifndef(`init_systemd',...) block?

I do not believe that udev should be able to do this at all. Please explain why you would want to add these rules

Quoted 33 lines

Kindly Regards,
Christian G?ttsche

2016-12-18 19:13 GMT+01:00 Guido Trentalancia via refpolicy <[email protected]>:

Quoted 19 lines

Update the udev module so that the udev domain can manage tmpfs files and directories.

---
 policy/modules/system/udev.te |    2 ++
 1 file changed, 2 insertions(+)
policy/modules/system/udev.te 2016-12-18 18:09:55.935617782 +0100 renamed from policy/modules/system/udev.te 2016-09-10 18:09:13.359710389 +0200 +2 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 files_search_mnt(udev_t)
 
 fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 fs_list_inotifyfs(udev_t)
 fs_rw_anon_inodefs_files(udev_t)
 
Quoted 4 lines

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161218/561858c5/attachment.bin 
#4 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

Quoted 10 lines · Dominick Grift via refpolicy
Quoted 6 lines · cgzones via refpolicy

Hi,
on debian with systemd's udev these permissions are not needed, maybe
you can put hem into a ifndef(`init_systemd',...) block?

I do not believe that udev should be able to do this at all. Please explain why you would want to add these rules

It needs the permissions to manage /run during bootup.

Quoted 22 lines
Quoted 22 lines

Kindly Regards,
?Christian G?ttsche

2016-12-18 19:13 GMT+01:00 Guido Trentalancia via refpolicy <[email protected]>:

Quoted 17 lines

Update the udev module so that the udev domain can manage tmpfs files
and directories.

---
?policy/modules/system/udev.te |????2 ++
?1 file changed, 2 insertions(+)

--- a/policy/modules/system/udev.te?????2016-09-10 18:09:13.359710389 +0200
+++ b/policy/modules/system/udev.te?????2016-12-18 18:09:55.935617782 +0100

(quoted diff) +0 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 ?files_search_mnt(udev_t)
 
Quoted 5 lines
Quoted 5 lines

Review files_getattr_generic_locks(udev_t) · line 132

Quoted 5 lines
(quoted diff) +2 -0
 ?fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 ?fs_list_inotifyfs(udev_t)
 ?fs_rw_anon_inodefs_files(udev_t)

Guido

#5 lore raw

PATCH 1/1 udev: manage tmpfs files and directories

Quoted 9 lines · Guido Trentalancia via refpolicy
Quoted 8 lines · Dominick Grift via refpolicy
Quoted 6 lines · cgzones via refpolicy

Hi,
on debian with systemd's udev these permissions are not needed, maybe
you can put hem into a ifndef(`init_systemd',...) block?

Quoted 4 lines
Quoted 2 lines

I do not believe that udev should be able to do this at all. Please explain why you would want to add these rules

It needs the permissions to manage /run during bootup.

I see. Yes that makes sense i suppose.

Quoted 35 lines
Quoted 23 lines
Quoted 23 lines

Kindly Regards,
Christian G?ttsche

2016-12-18 19:13 GMT+01:00 Guido Trentalancia via refpolicy <[email protected]>:

Quoted 17 lines

Update the udev module so that the udev domain can manage tmpfs files
and directories.

---
 policy/modules/system/udev.te |    2 ++
 1 file changed, 2 insertions(+)

--- a/policy/modules/system/udev.te 2016-09-10
18:09:13.359710389 +0200
+++ b/policy/modules/system/udev.te 2016-12-18
18:09:55.935617782 +0100

policy/modules/system/udev.te +0 -0
@@ -123,6 +126,8 @@ files_getattr_generic_locks(udev_t)
 files_search_mnt(udev_t)
 
Quoted 5 lines
Quoted 5 lines

policy/modules/system/udev.te files_getattr_generic_locks(udev_t) · line 132

Quoted 5 lines
policy/modules/system/udev.te +2 -0
 fs_getattr_all_fs(udev_t)
+fs_manage_tmpfs_dirs(udev_t)
+fs_manage_tmpfs_files(udev_t)
 fs_list_inotifyfs(udev_t)
 fs_rw_anon_inodefs_files(udev_t)

Guido
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy

Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161218/c63db070/attachment.bin 
#6 lore raw

PATCH v2 1/1 udev: manage tmpfs files and directories

In reply to Guido Trentalancia

Update the udev module so that the udev domain can manage tmpfs files and directories.

Thanks to Christian G?ttsche for pointing out that this only applies to systems not using systemd (v2).

---
 policy/modules/system/udev.te |    3 +++
 1 file changed, 3 insertions(+)
policy/modules/system/udev.te +3 -0
@@ -229,6 +231,9 @@ ifdef(`init_systemd',`
 	init_dgram_send(udev_t)
 
 	systemd_read_logind_pids(udev_t)
+',`
+	fs_manage_tmpfs_dirs(udev_t)
+	fs_manage_tmpfs_files(udev_t)
 ')
 
 optional_policy(`
#7 lore raw

PATCH v2 1/1 udev: manage tmpfs files and directories

Quoted 14 lines · Guido Trentalancia via refpolicy

Update the udev module so that the udev domain can manage tmpfs files and directories.

Thanks to Christian G?ttsche for pointing out that this only applies to systems not using systemd (v2).

---
 policy/modules/system/udev.te |    3 +++
 1 file changed, 3 insertions(+)

policy/modules/system/udev.te ifdef(`init_systemd',` · line 238

Quoted 8 lines
policy/modules/system/udev.te +3 -0
@@ -229,6 +231,9 @@ ifdef(`init_systemd',`
 	init_dgram_send(udev_t)
 
 	systemd_read_logind_pids(udev_t)
+',`
+	fs_manage_tmpfs_dirs(udev_t)
+	fs_manage_tmpfs_files(udev_t)
 ')
 

Merged.

Signature · 1 line
Chris PeBenito