summaryrefslogtreecommitdiff
path: root/source4/kdc/hdb-samba4.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-11-07 17:21:44 +0100
committerStefan Metzmacher <metze@samba.org>2022-11-24 11:01:37 +0000
commit1414269dccfd7cb831889cc92df35920b034457c (patch)
treec149aacb911543e2a5c9d1206f54fc9c907b244a /source4/kdc/hdb-samba4.c
parent2dcd8369fe7e6c7664f5e18324e85e0c4eebb2d5 (diff)
downloadsamba-1414269dccfd7cb831889cc92df35920b034457c.tar.gz
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>
Diffstat (limited to 'source4/kdc/hdb-samba4.c')
-rw-r--r--source4/kdc/hdb-samba4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c
index 699ef9a577c..527fa6b627b 100644
--- a/source4/kdc/hdb-samba4.c
+++ b/source4/kdc/hdb-samba4.c
@@ -653,7 +653,7 @@ static krb5_error_code hdb_samba4_audit(krb5_context context,
* in the PAC here or re-calculate it.
*/
status = authsam_logon_success_accounting(kdc_db_ctx->samdb, p->msg,
- domain_dn, true, &send_to_sam);
+ domain_dn, true, frame, &send_to_sam);
if (NT_STATUS_EQUAL(status, NT_STATUS_ACCOUNT_LOCKED_OUT)) {
final_ret = KRB5KDC_ERR_CLIENT_REVOKED;
r->error_code = final_ret;