diff --git a/policy/modules/kernel/corecommands.te b/policy/modules/kernel/corecommands.te index cc63dcc9c9..839a9453f9 100644 --- a/policy/modules/kernel/corecommands.te +++ b/policy/modules/kernel/corecommands.te @@ -10,6 +10,8 @@ policy_module(corecommands, 1.18.1) # attribute exec_type; +init_bpf_map_rw(exec_type) + # # bin_t is the type of files in the system bin/sbin directories. # diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 95881f4756..6fe70555b9 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -3569,6 +3569,24 @@ interface(`init_prog_run_bpf',` allow $1 init_t:bpf { map_create map_read map_write prog_load prog_run }; ') +######################################## +## +## Allow caller domain to map_read/map_write to init. +## +## +## +## Domain allowed access. +## +## +# +interface(`init_bpf_map_rw',` + gen_require(` + type init_t; + ') + + allow $1 init_t:bpf { map_read map_write }; +') + ####################################### ## ## Allow systemd to watch directories of given type.