CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.
commit3ddc9344c2fa7461336899fbddb0bb80995e9170
authorJeremy Allison <jra@samba.org>
Tue, 7 Jun 2022 16:53:08 +0000 (7 09:53 -0700)
committerJule Anger <janger@samba.org>
Wed, 27 Jul 2022 11:46:46 +0000 (27 11:46 +0000)
tree0d6e9a94f39a1ce186499e75c94f79188cc00007
parenta60863458dc6b60a09aa8d31fada6c36f5043c76
CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.

Fixes the raw.write.bad-write test.

NB. We need the two (==0) changes in source3/smbd/smb2_reply.c
as the gcc optimizer now knows that the return from
smbreq_bufrem() can never be less than zero.

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

Remove knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Jule Anger <janger@samba.org>
Autobuild-Date(master): Wed Jul 27 11:46:46 UTC 2022 on sn-devel-184
selftest/knownfail.d/bad-write [deleted file]
source3/include/smb_macros.h
source3/smbd/smb2_reply.c