CVE-2021-20251 s4:dsdb: Update bad password count inside transaction
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sat, 9 Jul 2022 03:44:21 +0000 (15:44 +1200)
committerJule Anger <janger@samba.org>
Mon, 19 Sep 2022 04:02:12 +0000 (04:02 +0000)
commit254e94892cd3b561f5d17e7008b792fa7948c68b
tree87cb400d263c920836c19b3bb194c7693eb2fdfe
parent3a96ccbb8414b2642836cf88ea5531040fc658b4
CVE-2021-20251 s4:dsdb: Update bad password count inside transaction

Previously, there was a gap between calling dsdb_update_bad_pwd_count()
and dsdb_module_modify() where no transaction was in effect. Another
process could slip in and modify badPwdCount, only for our update to
immediately overwrite it. Doing the update inside the transaction will
help for the following commit when we make it atomic.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit a65147a9e98ead70869cdfa20ffcc9c167dbf535)
source4/dsdb/samdb/ldb_modules/password_hash.c