ndr: always attempt ACE coda pull if ACE type suggests a coda
commit6fb98f70c6274e172787c8d5f73aa93920171e7c
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 22 Mar 2024 19:27:41 +0000 (23 08:27 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 25 Mar 2024 06:00:21 +0000 (25 06:00 +0000)
treeb8617207d6273ed25fab6a5dafad3d291b9c6a71
parent7edf5467fc77cc1039c0ef9fd4579bfb7333c159
ndr: always attempt ACE coda pull if ACE type suggests a coda

We were skipping the pull in cases where the coda size was calculated
to be zero. This has the right result for empty conditional ACEs, but
not for Resource Attribute ACEs where the
CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 coda was not intialised.

The situation is made a bit worse, because the function that
calculates the coda size (ndr_subcontext_size_of_ace_coda()) can
return zero in conditions that are not exactly errors, but in which
the would-be calculated value makes so little sense that zero is
thought to be a safer default.

Credit to OSS-Fuzz.

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66577
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15613

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Mar 25 06:00:21 UTC 2024 on atb-devel-224
librpc/ndr/ndr_sec_helper.c