File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,7 @@ ifdef(`distro_redhat',`
297297#
298298/sys(/.*)? gen_context(system_u:object_r:sysfs_t,s0)
299299/sys/devices/system/cpu/online gen_context(system_u:object_r:cpu_online_t,s0)
300+ /sys/devices/system/memory/soft_offline_page gen_context(system_u:object_r:memory_offline_page_t,s0)
300301
301302/usr/lib/udev/devices(/.*)? gen_context(system_u:object_r:device_t,s0)
302303/usr/lib/udev/devices/lp.* -c gen_context(system_u:object_r:printer_device_t,s0)
Original file line number Diff line number Diff line change @@ -5180,6 +5180,29 @@ interface(`dev_relabel_cpu_online',`
51805180 allow $1 cpu_online_t:file relabel_file_perms;
51815181')
51825182
5183+ ########################################
5184+ ## <summary>
5185+ ## Write memory offline page.
5186+ ## </summary>
5187+ ## <desc>
5188+ ## <p>
5189+ ## Allow the specified domain write to /sys/devices/system/memory/soft_offline_page
5190+ ## </p>
5191+ ## </desc>
5192+ ## <param name="domain">
5193+ ## <summary>
5194+ ## Domain allowed access.
5195+ ## </summary>
5196+ ## </param>
5197+ #
5198+ interface(`dev_write_memory_offline_page',`
5199+ gen_require(`
5200+ type memory_offline_page_t;
5201+ ')
5202+
5203+ dev_search_sysfs($1)
5204+ allow $1 memory_offline_page_t:file read_file_perms;
5205+ ')
51835206
51845207########################################
51855208## <summary>
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ attribute device_node;
99attribute memory_raw_read;
1010attribute memory_raw_write;
1111attribute devices_unconfined_type;
12+ attribute sysfs_type;
1213
1314#
1415# device_t is the type of /dev.
@@ -383,10 +384,14 @@ files_mountpoint(sysfs_t)
383384fs_type(sysfs_t)
384385genfscon sysfs / gen_context(system_u:object_r :sysfs_t,s0 )
385386
386- type cpu_online_t;
387+ type cpu_online_t, sysfs_type ;
387388files_type(cpu_online_t)
388389dev_associate_sysfs(cpu_online_t)
389390
391+ type memory_offline_page_t, sysfs_type;
392+ files_type(memory_offline_page_t)
393+ dev_associate_sysfs(memory_offline_page_t)
394+
390395#
391396# Type for /dev/tmc_etb[0-9]+ /dev/tmc_etf[0-9]+ /dev/tmc_etr[0-9]+
392397#
You can’t perform that action at this time.
0 commit comments