Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

sasikuma-qti
Copy link

@sasikuma-qti sasikuma-qti commented Oct 14, 2025

In minimal systems, /bin/sh is often a symlink to busybox.
SELinux expects /bin/sh to be labeled shell_exec_t, so busybox bins
can be labeled with shell_exec_t.

Reference:
https://git.yoctoproject.org/poky/tree/meta/recipes-core/busybox/busybox.inc#n251

Denials:
[ 12.593748] audit: type=1400 audit(15.527:68): avc: denied { map } for pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid"
dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[ 12.627879] audit: type=1400 audit(15.527:68): avc: denied { read execute } for pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid"
dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[ 12.627894] audit: type=1400 audit(15.539:69): avc: denied { map } for pid=1480 comm="syslogd" path="/usr/bin/busybox.nosuid"
dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[ 12.627897] audit: type=1400 audit(15.539:69): avc: denied { read execute } for pid=1480 comm="syslogd"
path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

labelling busybox bins as shell_exec_t, ensuring compatibility with
refpolicy expectations and avoiding SELinux denials.

@sasikuma-qti sasikuma-qti force-pushed the main branch 3 times, most recently from 028c451 to d1b06ca Compare October 15, 2025 06:50
@sasikuma-qti sasikuma-qti changed the title busybox: label busybox.nosuid as shell_exec_t busybox Oct 15, 2025
In minimal systems, /bin/sh is often a symlink to busybox.
SELinux expects /bin/sh to be labeled shell_exec_t, so busybox bins
can be labeled with shell_exec_t.

Reference:
https://git.yoctoproject.org/poky/tree/meta/recipes-core/busybox/busybox.inc#n251

Denials:
[   12.593748] audit: type=1400 audit(15.527:68): avc:  denied  { map } for  pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid"
dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[   12.627879] audit: type=1400 audit(15.527:68): avc:  denied  { read execute } for  pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid"
 dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[   12.627894] audit: type=1400 audit(15.539:69): avc:  denied  { map } for  pid=1480 comm="syslogd" path="/usr/bin/busybox.nosuid"
 dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1
[   12.627897] audit: type=1400 audit(15.539:69): avc:  denied  { read execute } for  pid=1480 comm="syslogd"
path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

labelling busybox bins as shell_exec_t, ensuring compatibility with
refpolicy expectations and avoiding SELinux denials.

Signed-off-by: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com>
sasikuma-qti pushed a commit to sasikuma-qti/meta-qcom-selinux that referenced this pull request Oct 15, 2025
In minimal systems, /bin/sh is often a symlink to busybox.
SELinux expects /bin/sh to be labeled shell_exec_t, so busybox binaries
can be labeled with shell_exec_t.

Reference:
https://git.yoctoproject.org/poky/tree/meta/recipes-core/busybox/busybox.inc#n251

Denials:
[   12.593748] audit: type=1400 audit(15.527:68): avc:  denied  { map } for  pid=1477
comm="klogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0
tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627879] audit: type=1400 audit(15.527:68): avc:  denied  { read execute } for
pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359
scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627894] audit: type=1400 audit(15.539:69): avc:  denied  { map } for  pid=1480
comm="syslogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0
tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627897] audit: type=1400 audit(15.539:69): avc:  denied  { read execute } for  pid=1480
comm="syslogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0
 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

labelling busybox binaries as shell_exec_t, ensuring compatibility with
refpolicy expectations and avoiding SELinux denials.

Upstream-Status: Submitted [SELinuxProject/refpolicy#1033]

Signed-off-by: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com>
sasikuma-qti pushed a commit to sasikuma-qti/meta-qcom-selinux that referenced this pull request Oct 15, 2025
In minimal systems, /bin/sh is often a symlink to busybox.
SELinux expects /bin/sh to be labeled shell_exec_t, so busybox binaries
can be labeled with shell_exec_t.

Reference:
https://git.yoctoproject.org/poky/tree/meta/recipes-core/busybox/busybox.inc#n251

Denials:
[   12.593748] audit: type=1400 audit(15.527:68): avc:  denied  { map } for  pid=1477
comm="klogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:klogd_t:s0
tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627879] audit: type=1400 audit(15.527:68): avc:  denied  { read execute } for
pid=1477 comm="klogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359
scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627894] audit: type=1400 audit(15.539:69): avc:  denied  { map } for  pid=1480
comm="syslogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0
tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

[   12.627897] audit: type=1400 audit(15.539:69): avc:  denied  { read execute } for  pid=1480
comm="syslogd" path="/usr/bin/busybox.nosuid" dev="sda2" ino=359 scontext=system_u:system_r:syslogd_t:s0
 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=1

labelling busybox binaries as shell_exec_t, ensuring compatibility with
refpolicy expectations and avoiding SELinux denials.

Upstream-Status: Submitted [SELinuxProject/refpolicy#1033]

Signed-off-by: Sasi Kumar Maddineni <quic_sasikuma@quicinc.com>
@sasikuma-qti
Copy link
Author

cc @pebenito

@pebenito
Copy link
Member

I don't think this is the right choice. If you're executing the busybox binary directly, the intent is unknown, so bin_t makes the most sense. I don't know the busybox build option off the top of my head, but you should enable the tiny entrypoint executables, as they get poper labeling. For example, on my busybox system I have this:

# ls -lZ /usr/lib/busybox/usr/bin/sh
-rwxr-xr-x    1 root     root     system_u:object_r:shell_exec_t          25 Sep 30 23:20 /usr/lib/busybox/usr/bin/sh

@pebenito pebenito closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.