mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-22 04:15:42 -05:00
Merge tag 'selinux-pr-20250624' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore: "Another small SELinux patch to fix a problem seen by the dracut-ng folks during early boot when SELinux is enabled, but the policy has yet to be loaded" * tag 'selinux-pr-20250624' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: change security_compute_sid to return the ssid or tsid on match
This commit is contained in:
@@ -1909,11 +1909,17 @@ static int security_compute_sid(u32 ssid,
|
||||
goto out_unlock;
|
||||
}
|
||||
/* Obtain the sid for the context. */
|
||||
rc = sidtab_context_to_sid(sidtab, &newcontext, out_sid);
|
||||
if (rc == -ESTALE) {
|
||||
rcu_read_unlock();
|
||||
context_destroy(&newcontext);
|
||||
goto retry;
|
||||
if (context_equal(scontext, &newcontext))
|
||||
*out_sid = ssid;
|
||||
else if (context_equal(tcontext, &newcontext))
|
||||
*out_sid = tsid;
|
||||
else {
|
||||
rc = sidtab_context_to_sid(sidtab, &newcontext, out_sid);
|
||||
if (rc == -ESTALE) {
|
||||
rcu_read_unlock();
|
||||
context_destroy(&newcontext);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
out_unlock:
|
||||
rcu_read_unlock();
|
||||
|
||||
Reference in New Issue
Block a user