mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 19:55:32 +00:00
selinux: set next pointer before attaching to list
commit70d91dc9b2
upstream. Set the next pointer in filename_trans_read_helper() before attaching the new node under construction to the list, otherwise garbage would be dereferenced on subsequent failure during cleanup in the out goto label. Cc: <stable@vger.kernel.org> Fixes:4300590243
("selinux: implement new format of filename transitions") Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
92514b9b59
commit
4f1f7bbf7e
1 changed files with 1 additions and 1 deletions
|
@ -2011,6 +2011,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 */
|
||||
|
@ -2023,7 +2024,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue