Skip to content

Commit

Permalink
Merge tag 'selinux-pr-20230821' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Aug 22, 2023
2 parents f775712 + 70d91dc commit e4311f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/ss/policydb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
}
Expand Down

0 comments on commit e4311f7

Please sign in to comment.