summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-08-22 20:38:29 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-08-22 20:38:29 +0300
commite4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e (patch)
treeb6621312644c7aefa9c2581dd6fbea80de2ecacf /security
parentf7757129e3dea336c407551c98f50057c22bb266 (diff)
parent70d91dc9b2ac91327d0eefd86163abc3548effa6 (diff)
downloadlinux-e4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e.tar.xz
Merge tag 'selinux-pr-20230821' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore: "A small fix for a potential problem when cleaning up after a failed SELinux policy load (list next pointer not being properly initialized to NULL early enough)" * tag 'selinux-pr-20230821' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: set next pointer before attaching to list
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/policydb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 31b08b34c722..dc904865af58 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -2005,6 +2005,7 @@ static int filename_trans_read_helper(struct policydb *p, void *fp)
if (!datum)
goto out;
+ datum->next = NULL;
*dst = datum;
/* ebitmap_read() will at least init the bitmap */
@@ -2017,7 +2018,6 @@ static int filename_trans_read_helper(struct policydb *p, void *fp)
goto out;
datum->otype = le32_to_cpu(buf[0]);
- datum->next = NULL;
dst = &datum->next;
}