gsskrb5: CVE-2022-3437 Pass correct length to _gssapi_verify_pad()
commit2a4210b7e99a9126b29aeb1e58cc327069d01097
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 12 Oct 2022 00:57:33 +0000 (12 13:57 +1300)
committerNicolas Williams <nico@twosigma.com>
Tue, 15 Nov 2022 23:51:45 +0000 (15 17:51 -0600)
treea1275868c2f33fd2b28c91c579c6e55ee6a9e9cc
parent22749e918fcf29fd29d2ea05d10d78226c6a5b36
gsskrb5: CVE-2022-3437 Pass correct length to _gssapi_verify_pad()

We later subtract 8 when calculating the length of the output message
buffer. If padlength is excessively high, this calculation can underflow
and result in a very large positive value.

Now we properly constrain the value of padlength so underflow shouldn't
be possible.

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

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/gssapi/krb5/unwrap.c