Skip to content

Commit fe331f4

Browse files
[Low] Patch apparmor for CVE-2023-53154 (#14011)
1 parent 6939a03 commit fe331f4

3 files changed

Lines changed: 91 additions & 1 deletion

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 1dfb03ca74b78ff4a87b48a70b91a5cfc985f9c4 Mon Sep 17 00:00:00 2001
2+
From: dj_palli <v-dpalli@microsoft.com>
3+
Date: Thu, 12 Jun 2025 20:49:56 +0000
4+
Subject: [PATCH] Address CVE-2023-53154
5+
6+
Upstream Patch Reference: https://github.com/DaveGamble/cJSON/commit/3ef4e4e730e5efd381be612df41e1ff3f5bb3c32
7+
8+
---
9+
binutils/cJSON.c | 5 +++++
10+
1 file changed, 5 insertions(+)
11+
12+
diff --git a/binutils/cJSON.c b/binutils/cJSON.c
13+
index e85ac11..45c1c45 100644
14+
--- a/binutils/cJSON.c
15+
+++ b/binutils/cJSON.c
16+
@@ -1650,6 +1650,11 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu
17+
current_item = new_item;
18+
}
19+
20+
+ if (cannot_access_at_index(input_buffer, 1))
21+
+ {
22+
+ goto fail; /* nothing comes after the comma */
23+
+ }
24+
+
25+
/* parse the name of the child */
26+
input_buffer->offset++;
27+
buffer_skip_whitespace(input_buffer);
28+
--
29+
2.45.2
30+

SPECS/apparmor/apparmor.spec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: AppArmor is an effective and easy-to-use Linux application security system.
22
Name: apparmor
33
Version: 3.0.4
4-
Release: 4%{?dist}
4+
Release: 5%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -11,8 +11,12 @@ Source0: https://launchpad.net/apparmor/3.0/3.0.4/+download/%{name}-%{ver
1111
Patch1: apparmor-service-start-fix.patch
1212
Patch2: CVE-2023-50471.patch
1313
Patch3: CVE-2024-31755.patch
14+
Patch4: CVE-2023-53154.patch
15+
Patch5: removed_unused_global_variables_fix_test-aa.patch
16+
1417
# CVE-2016-1585 has no upstream fix as of 2020/09/28
1518
Patch100: CVE-2016-1585.nopatch
19+
1620
BuildRequires: apr
1721
BuildRequires: apr-util-devel
1822
BuildRequires: autoconf
@@ -355,6 +359,10 @@ make DESTDIR=%{buildroot} install
355359
%exclude %{perl_archlib}/perllocal.pod
356360

357361
%changelog
362+
* Fri Jun 13 2025 Durga Jagadeesh Palli <v-dpalli@microsoft.com> - 3.0.4-5
363+
- Patch CVE-2023-53154
364+
- Patch removed_unused_global_variables_fix_test-aa.patch to fix PTest failure
365+
358366
* Thu May 30 2024 Sumedh Sharma <sumsharma@microsoft.com> - 3.0.4-4
359367
- Add patch for CVE-2024-31755
360368

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 91b1b21fe68bdbcb51552cc2dc2e930da139a123 Mon Sep 17 00:00:00 2001
2+
From: dj_palli <v-dpalli@microsoft.com>
3+
Date: Thu, 10 Jul 2025 07:22:28 +0000
4+
Subject: [PATCH] Address ptest error fix
5+
6+
Description: fix the Ptest failure by removing the unused global variables in test-aa
7+
8+
---
9+
utils/apparmor/aa.py | 1 -
10+
utils/apparmor/common.py | 1 -
11+
utils/test/test-aa-easyprof.py | 1 -
12+
3 files changed, 3 deletions(-)
13+
14+
diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py
15+
index 4ba484d..71754aa 100644
16+
--- a/utils/apparmor/aa.py
17+
+++ b/utils/apparmor/aa.py
18+
@@ -1486,7 +1486,6 @@ def set_logfile(filename):
19+
def do_logprof_pass(logmark=''):
20+
# set up variables for this pass
21+
# transitions = hasher()
22+
- global active_profiles
23+
global sev_db
24+
# aa = hasher()
25+
# changed = dict()
26+
diff --git a/utils/apparmor/common.py b/utils/apparmor/common.py
27+
index bbe2834..b4ae059 100644
28+
--- a/utils/apparmor/common.py
29+
+++ b/utils/apparmor/common.py
30+
@@ -69,7 +69,6 @@ def msg(out, output=sys.stdout):
31+
32+
def debug(out):
33+
'''Print debug message'''
34+
- global DEBUGGING
35+
if DEBUGGING:
36+
try:
37+
print("DEBUG: %s" % (out), file=sys.stderr)
38+
diff --git a/utils/test/test-aa-easyprof.py b/utils/test/test-aa-easyprof.py
39+
index d205797..9d8e51c 100755
40+
--- a/utils/test/test-aa-easyprof.py
41+
+++ b/utils/test/test-aa-easyprof.py
42+
@@ -108,7 +108,6 @@ class T(unittest.TestCase):
43+
44+
def setUp(self):
45+
'''Setup for tests'''
46+
- global topdir
47+
48+
self.tmpdir = os.path.realpath(tempfile.mkdtemp(prefix='test-aa-easyprof'))
49+
50+
--
51+
2.45.2
52+

0 commit comments

Comments
 (0)