merge fix-cve-2026-85231-openEuler-22.03-LTS-SP4 into openEuler-22.03-LTS-SP4
2 file(s) changed+61-1
Abackport-CVE-2026-85231.patch+53-0
| @@ -0,0 +1,53 @@ | |||
| 1 | +From 65d27459fe569a678cb5cc67d308bcf12c49cb40 Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Olga Kornievskaia <okorniev@redhat.com> | ||
| 3 | +Date: Sat, 12 Sep 2026 15:17:50 -0400 | ||
| 4 | +Subject: [PATCH] libtirpc: Bound maxsize in xdr_rpc_gss_unwrap_data() decode | ||
| 5 | + calls | ||
| 6 | + | ||
| 7 | +xdr_rpc_gss_unwrap_data() passes (u_int)-1 as maxsize to | ||
| 8 | +xdr_rpc_gss_buf() for all three decode calls (databody_integ, | ||
| 9 | +checksum, databody_priv). This disables the length check in | ||
| 10 | +xdr_bytes(), allowing a fabricated length field in a small RPC | ||
| 11 | +message to trigger a multi-GB allocation before GSS verification. | ||
| 12 | + | ||
| 13 | +Replace (u_int)-1 with RPCSEC_GSS_MAX_UNWRAP (16 MB). The encode | ||
| 14 | +path already uses bounded values (wrapbuf.length + RPC_SLACK_SPACE). | ||
| 15 | + | ||
| 16 | +Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> | ||
| 17 | +Signed-off-by: Steve Dickson <steved@redhat.com> | ||
| 18 | +Reference: https://github.com/Benetti-Engineering/libtirpc/commit/65d27459fe569a678cb5cc67d308bcf12c49cb40.patch | ||
| 19 | +Conflict: NA | ||
| 20 | + | ||
| 21 | +--- | ||
| 22 | + src/authgss_prot.c | 7 +++++-- | ||
| 23 | + 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 24 | + | ||
| 25 | +diff --git a/src/authgss_prot.c b/src/authgss_prot.c | ||
| 26 | +index c2b25db..c7de1fd 100644 | ||
| 27 | +--- a/src/authgss_prot.c | ||
| 28 | ++++ b/src/authgss_prot.c | ||
| 29 | +@@ -51,6 +51,9 @@ | ||
| 30 | + /* additional space needed for encoding */ | ||
| 31 | + #define RPC_SLACK_SPACE 1024 | ||
| 32 | + | ||
| 33 | ++/* upper bound on decoded RPCSEC_GSS wrapped payload (16 MB) */ | ||
| 34 | ++#define RPCSEC_GSS_MAX_UNWRAP (16U * 1024U * 1024U) | ||
| 35 | ++ | ||
| 36 | + bool_t | ||
| 37 | + xdr_rpc_gss_buf(XDR *xdrs, gss_buffer_t buf, u_int maxsize) | ||
| 38 | + { | ||
| 39 | +@@ -227,12 +230,12 @@ xdr_rpc_gss_unwrap_data(XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr, | ||
| 40 | + | ||
| 41 | + if (svc == RPCSEC_GSS_SVC_INTEGRITY) { | ||
| 42 | + /* Decode databody_integ. */ | ||
| 43 | +- if (!xdr_rpc_gss_buf(xdrs, &databuf, (u_int)-1)) { | ||
| 44 | ++ if (!xdr_rpc_gss_buf(xdrs, &databuf, RPCSEC_GSS_MAX_UNWRAP)) { | ||
| 45 | + LIBTIRPC_DEBUG(1, ("xdr_rpc_gss_unwrap_data: decode databody_integ failed")); | ||
| 46 | + return (FALSE); | ||
| 47 | + } | ||
| 48 | + /* Decode checksum. */ | ||
| 49 | +- if (!xdr_rpc_gss_buf(xdrs, &wrapbuf, (u_int)-1)) { | ||
| 50 | ++ if (!xdr_rpc_gss_buf(xdrs, &wrapbuf, RPCSEC_GSS_MAX_UNWRAP)) { | ||
| 51 | + gss_release_buffer(&min_stat, &databuf); | ||
| 52 | + LIBTIRPC_DEBUG(1, ("xdr_rpc_gss_unwrap_data: decode checksum failed")); | ||
| 53 | + return (FALSE); | ||
Mlibtirpc.spec+8-1
Comments
Sign in to comment