]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selinux: set next pointer before attaching to list
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 18 Aug 2023 15:33:58 +0000 (17:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2023 12:52:40 +0000 (14:52 +0200)
commit21cd99431aae3868748c7d9791a14e29103091f8
tree757dba9860667b54d9e44f81e954ad72667196aa
parent14fa028a2e63869855e4d3796622f21d790453cb
selinux: set next pointer before attaching to list

commit 70d91dc9b2ac91327d0eefd86163abc3548effa6 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: 430059024389 ("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>
security/selinux/ss/policydb.c