summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-08-22 19:38:29 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2023-08-22 19:38:29 +0200
commite4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e (patch)
treeb6621312644c7aefa9c2581dd6fbea80de2ecacf /security
parentMerge tag 'v6.5-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/... (diff)
parentselinux: set next pointer before attaching to list (diff)
downloadlinux-e4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e.tar.xz
linux-e4311f7c0508d6d0d1176a0d7b7ef3ab4a24be1e.zip
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;
}