Skip to contentSkip to conversation

init: smoother system boot

PATCH New Guido Trentalancia 2 participants 3 messages Apr 29, 2017 – Apr 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 init: smoother system boot

Improve the initrc domain within the init module with some permissions needed for a smoother boot.

Let the iptables init scripts read the iptables configuration.

---
 policy/modules/system/init.te |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
policy/modules/system/init.te +6 -0
@@ -420,6 +420,7 @@ kernel_clear_ring_buffer(initrc_t)
 kernel_get_sysvipc_info(initrc_t)
 kernel_read_all_sysctls(initrc_t)
 kernel_rw_all_sysctls(initrc_t)
+kernel_use_fds(initrc_t)
 # for lsof which is used by alsa shutdown:
 kernel_dontaudit_getattr_message_if(initrc_t)
 # cjp: not sure why these are here; should use mount policy
@@ -427,6 +428,7 @@ kernel_list_unlabeled(initrc_t)
 kernel_mounton_unlabeled_dirs(initrc_t)
 
 files_create_lock_dirs(initrc_t)
+files_manage_all_locks(initrc_t)
 files_pid_filetrans_lock_dir(initrc_t, "lock")
 files_read_kernel_symbol_table(initrc_t)
 files_setattr_lock_dirs(initrc_t)
@@ -905,6 +906,10 @@ optional_policy(`
 ')
 
 optional_policy(`
+	iptables_read_config(initrc_t)
+')
+
+optional_policy(`
 	iscsi_stream_connect(initrc_t)
 	iscsi_read_lib_files(initrc_t)
 ')
#1 lore raw

PATCH 3/7 init: smoother system boot

Quoted 1 line · Guido Trentalancia via refpolicy

+kernel_use_fds(initrc_t)

Why is this needed?

If a kernel fd is inherited by init_t and then passed on to initrc_t then it's probably a fd leak which should be fixed.

Maybe this is a candidate for ifdef(hide_broken_symptoms',...

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#2 lore raw

PATCH 3/7 init: smoother system boot

Hi!

I don't think so. It is the file descriptor of the pseudo terminal.

It is required for printing out boot stage information (such as status of launched services) to the correct terminal...

I hope this helps.

Regards,

Guido

Quoted 10 lines · Russell Coker
Quoted 1 line · Guido Trentalancia via refpolicy

+kernel_use_fds(initrc_t)

Why is this needed?

If a kernel fd is inherited by init_t and then passed on to initrc_t then it's
probably a fd leak which should be fixed.

Maybe this is a candidate for ifdef(hide_broken_symptoms',...