CVE-2022-32742: s3: smbd: Harden the smbreq_bufrem() macro.
authorJeremy Allison <jra@samba.org>
Wed, 8 Jun 2022 20:50:51 +0000 (13:50 -0700)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:55:51 +0000 (11:55 +0200)
commita4707e4a955d01edf493cd0d7ab8b1ecb4ca7991
tree5f2bca2c6432c8c6acfbc3bf6adff0ad91f985a0
parentd6aef6838a674ab95ff9172f4ac67707667f9e00
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/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>
selftest/knownfail.d/bad-write [deleted file]
source3/include/smb_macros.h
source3/smbd/reply.c