]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selinux: change security_compute_sid to return the ssid or tsid on match
authorStephen Smalley <stephen.smalley.work@gmail.com>
Tue, 10 Jun 2025 19:48:27 +0000 (15:48 -0400)
committerPaul Moore <paul@paul-moore.com>
Thu, 19 Jun 2025 20:13:16 +0000 (16:13 -0400)
commitfde46f60f6c5138ee422087addbc5bf5b4968bf1
treeca3e5acb47fecdb305f92160e18a4857a5814645
parent86c8db86af43f52f682e53a0f2f0828683be1e52
selinux: change security_compute_sid to return the ssid or tsid on match

If the end result of a security_compute_sid() computation matches the
ssid or tsid, return that SID rather than looking it up again. This
avoids the problem of multiple initial SIDs that map to the same
context.

Cc: stable@vger.kernel.org
Reported-by: Guido Trentalancia <guido@trentalancia.com>
Fixes: ae254858ce07 ("selinux: introduce an initial SID for early boot processes")
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Tested-by: Guido Trentalancia <guido@trentalancia.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/ss/services.c