Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions container.te
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ tunable_policy(`container_connect_any',`
# spc local policy
#
allow spc_t { container_file_t container_var_lib_t container_ro_file_t container_runtime_tmpfs_t}:file entrypoint;
allow spc_t self:process { execstack execmem };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Allowing execstack (executable stack) poses a significant security risk as it makes memory corruption vulnerabilities (like buffer overflows) much easier to exploit. While execmem is commonly required by runtimes like Java for Just-In-Time (JIT) compilation, execstack is rarely needed by modern applications. To adhere to the principle of least privilege, consider allowing only execmem unless there is a verified requirement for execstack in spc_t containers.

allow spc_t self:process { execmem };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the AI did not read my commit message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this as a boolean. I would allow execmem by default and have a container_can_execstack boolean. Then users can just toggle the boolean.

role system_r types spc_t;
dontaudit spc_t self:memprotect mmap_zero;

Expand Down