CVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()
authorStefan Metzmacher <metze@samba.org>
Mon, 7 Nov 2022 16:21:44 +0000 (17:21 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 12 Dec 2022 15:52:22 +0000 (15:52 +0000)
commita1136ed2e05a2adca83a57a0402a165de631be58
tree272147227cfd551791e5949554cb514f5290d37f
parent2736d267aa9cfd49bd1c9a934d4788a2b9c49809
CVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting()

This fixes a use after free problem introduced by
commit 7b8e32efc336fb728e0c7e3dd6fbe2ed54122124,
which has msg = current; which means the lifetime
of the 'msg' memory is no longer in the scope of th
caller.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15253

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1414269dccfd7cb831889cc92df35920b034457c)

Autobuild-User(v4-16-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-16-test): Mon Dec 12 15:52:22 UTC 2022 on sn-devel-184
source4/auth/ntlm/auth_sam.c
source4/auth/ntlm/auth_winbind.c
source4/auth/sam.c
source4/auth/tests/sam.c
source4/kdc/hdb-samba4.c
source4/kdc/mit_samba.c