Commit e4311f7c authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents f7757129 70d91dc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}