Skip to content

Commit

Permalink
heimdal: Add backported patch for fixing CVE-2022-3116 (#10588)
Browse files Browse the repository at this point in the history
Signed-off-by: ankita <[email protected]>
Co-authored-by: ankita <[email protected]>
  • Loading branch information
Ankita13-code and ankita authored Oct 3, 2024
1 parent 268b018 commit 3832409
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
52 changes: 52 additions & 0 deletions SPECS/heimdal/CVE-2022-3116.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 2584657af19b706fe49225cc9227bbfded0ee704 Mon Sep 17 00:00:00 2001
From: ankita <[email protected]>
Date: Tue, 1 Oct 2024 16:05:50 +0530
Subject: [PATCH] heimdal: Fix NULL deref in spnego for fixing CVE-2022-3116

Signed-off-by: ankita <[email protected]>
---
lib/gssapi/spnego/accept_sec_context.c | 28 +++++++++++++-------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/lib/gssapi/spnego/accept_sec_context.c b/lib/gssapi/spnego/accept_sec_context.c
index 5fe1a1a..4920664 100644
--- a/lib/gssapi/spnego/accept_sec_context.c
+++ b/lib/gssapi/spnego/accept_sec_context.c
@@ -605,20 +605,20 @@ acceptor_start
* If opportunistic token failed, lets try the other mechs.
*/

- if (!first_ok && ni->mechToken != NULL) {
- size_t j;
-
- preferred_mech_type = GSS_C_NO_OID;
-
- /* Call glue layer to find first mech we support */
- for (j = 1; j < ni->mechTypes.len; ++j) {
- ret = select_mech(minor_status,
- &ni->mechTypes.val[j],
- 1,
- &preferred_mech_type);
- if (ret == 0)
- break;
- }
+ if (!first_ok) {
+ size_t j;
+
+ preferred_mech_type = GSS_C_NO_OID;
+
+ /* Call glue layer to find first mech we support */
+ for (j = 1; j < ni->mechTypes.len; ++j) {
+ ret = select_mech(minor_status,
+ &ni->mechTypes.val[j],
+ 1,
+ &preferred_mech_type);
+ if (ret == 0)
+ break;
+ }
}

ctx->preferred_mech_type = preferred_mech_type;
--
2.34.1

6 changes: 5 additions & 1 deletion SPECS/heimdal/heimdal.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Summary: A Kerberos 5 implementation without export restrictions
Name: heimdal
Version: 7.7.1
Release: 3%{?dist}
Release: 4%{?dist}
License: BSD AND MIT
Vendor: Microsoft Corporation
Distribution: Mariner
Expand Down Expand Up @@ -45,6 +45,7 @@ Patch4: CVE-2022-42898.patch
Patch5: 0001-lib-krb5-krb5_pac_parse-mem-leak-if-pac_header_size-.patch
Patch6: 0002-kdc-Check-generate_pac-return-code.patch
Patch7: 0003-kdc-avoid-re-encoding-KDC-REQ-BODY.patch
Patch8: CVE-2022-3116.patch
BuildRequires: bison
#libcom_err-devel is in
#BuildRequires: libcom_err-devel
Expand Down Expand Up @@ -487,6 +488,9 @@ fi
%{_sysconfdir}/profile.d/%{name}.csh

%changelog
* Tue Oct 01 2024 Ankita Pareek <[email protected]> - 7.7.1-4
- Add backported patch for CVE-2022-3116

* Thu Aug 24 2023 Muhammad Falak R Wani <[email protected]> - 7.7.1-3
- Address CVE-2022-42898
- Introduce 3 more patches that fix bugs: https://github.com/heimdal/heimdal/issues/1011
Expand Down

0 comments on commit 3832409

Please sign in to comment.