Skip to content

selinux: Cache SID lookups for domain checks (https://github.com/tiann/KernelSU/pull/3128)#1051

Merged
rifsxd merged 1 commit into
KernelSU-Next:devfrom
pershoot:dev1
Jan 6, 2026
Merged

selinux: Cache SID lookups for domain checks (https://github.com/tiann/KernelSU/pull/3128)#1051
rifsxd merged 1 commit into
KernelSU-Next:devfrom
pershoot:dev1

Conversation

@pershoot

@pershoot pershoot commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

selinux: Cache SID lookups for domain checks (tiann/KernelSU#3128)

Author: 0xSecureByte chirantan.code@gmail.com
Date: Mon Jan 5 14:17:14 2026 +0530

'Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons'.


Signed-off-by: 0xSecureByte chirantan.code@gmail.com
Co-authored-by: Copilot 175728472+Copilot@users.noreply.github.com

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pershoot

pershoot commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator Author
# dmesg | grep -i "failed to cache"
# dmesg | egrep -i "cached|sid '" | egrep -v "dma|mali|cpif"
[    1.609557] KernelSU: sid '89' is set for secctx_name 'u:r:priv_app:s0:c512,c768'
[    1.609567] KernelSU: sid '90' is set for secctx_name 'u:r:init:s0'
[    1.609571] KernelSU: sid '91' is set for secctx_name 'u:r:su:s0'
[    1.609574] KernelSU: sid '92' is set for secctx_name 'u:r:zygote:s0'
[    1.609577] KernelSU: Cached su SID: 91
[    1.609580] KernelSU: Cached zygote SID: 92
[    1.609582] KernelSU: Cached init SID: 90
[    1.609586] KernelSU: Cached ksu_file SID: 93
#

@0xSecureByte

Copy link
Copy Markdown
Contributor

@pershoot Thanks! Actually I was going to open a PR :)

@pershoot

pershoot commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator Author

@pershoot Thanks! Actually I was going to open a PR :)

np :)

@rifsxd rifsxd merged commit b9da018 into KernelSU-Next:dev Jan 6, 2026
17 of 18 checks passed
pershoot pushed a commit that referenced this pull request Jan 6, 2026
…1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pershoot pershoot deleted the dev1 branch January 6, 2026 16:54
Sorayukii pushed a commit to Sorayukii/KernelSU-Next that referenced this pull request Jan 25, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
Mr-Morat pushed a commit to Mr-Morat/KernelSU-Next that referenced this pull request Jan 28, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
slipzryzens pushed a commit to slipzryzens/KernelSU-Next that referenced this pull request Jan 31, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
maxsteeel pushed a commit to maxsteeel/KernelSU-Next that referenced this pull request Feb 1, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
rifsxd pushed a commit that referenced this pull request Feb 2, 2026
…1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
hakuna77 pushed a commit to hakuna77/KernelSU-Next that referenced this pull request Feb 3, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
slipzryzens pushed a commit to slipzryzens/KernelSU-Next that referenced this pull request Feb 5, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
ThRE-Team pushed a commit to ThRE-Team/KernelSU-Next that referenced this pull request Feb 12, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
slipzryzens pushed a commit to slipzryzens/KernelSU-Next that referenced this pull request Feb 16, 2026
…ernelSU-Next#1051)

Cache SELinux SIDs for su/zygote/init contexts at init time instead of
resolving them on every domain check. Reduces overhead from string-based
lookups to simple integer comparisons.

---------

Signed-off-by: 0xSecureByte <chirantan.code@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
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.

3 participants