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>
Thu, 24 Nov 2022 11:01:37 +0000 (11:01 +0000)
commit1414269dccfd7cb831889cc92df35920b034457c
treec149aacb911543e2a5c9d1206f54fc9c907b244a
parent2dcd8369fe7e6c7664f5e18324e85e0c4eebb2d5
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>
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