Skip to content

Commit 98efe6d

Browse files
[AutoPR- Security] Patch nasm for CVE-2022-46456 [MEDIUM] (#16211)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com>
1 parent bfd88b5 commit 98efe6d

2 files changed

Lines changed: 96 additions & 2 deletions

File tree

SPECS/nasm/CVE-2022-46456.patch

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
From ce3ea138398e68fb0529edd3df51ed2493fc4080 Mon Sep 17 00:00:00 2001
2+
From: "H. Peter Anvin" <hpa@zytor.com>
3+
Date: Sat, 30 Aug 2025 16:16:43 -0700
4+
Subject: [PATCH] ndisasm: make the assembler (hopefully) work again
5+
6+
- Significantly overhauled the disassembler internals to make
7+
better use of the information already in the instruction template
8+
and to reduce the implementation differences with the assembler
9+
- Add APX support to the disassembler
10+
- Fix problem with disassembler truncating addresses of jumps
11+
- Fix generation of invalid EAs in 16-bit mode
12+
- Fix array overrun for types in a few modules
13+
- Fix invalid ND flag on near JMP
14+
15+
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
16+
17+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
18+
Upstream-reference: https://github.com/netwide-assembler/nasm/commit/e05867ce3dfe303186f6c66df20251bfd828fd49
19+
---
20+
output/outdbg.c | 43 +++++++++++++++++++++++++++++++++++++++----
21+
1 file changed, 39 insertions(+), 4 deletions(-)
22+
23+
diff --git a/output/outdbg.c b/output/outdbg.c
24+
index e7a9a4e..04cb3dd 100644
25+
--- a/output/outdbg.c
26+
+++ b/output/outdbg.c
27+
@@ -408,9 +408,44 @@ dbg_pragma(const struct pragma *pragma)
28+
return DIRR_OK;
29+
}
30+
31+
-static const char * const types[] = {
32+
- "unknown", "label", "byte", "word", "dword", "float", "qword", "tbyte"
33+
-};
34+
+static const char *type_name(uint32_t type)
35+
+{
36+
+ switch (TYM_TYPE(type)) {
37+
+ case TY_UNKNOWN:
38+
+ return "unknown";
39+
+ case TY_LABEL:
40+
+ return "label";
41+
+ case TY_BYTE:
42+
+ return "byte";
43+
+ case TY_WORD:
44+
+ return "word";
45+
+ case TY_DWORD:
46+
+ return "dword";
47+
+ case TY_FLOAT:
48+
+ return "float";
49+
+ case TY_QWORD:
50+
+ return "qword";
51+
+ case TY_TBYTE:
52+
+ return "tbyte";
53+
+ case TY_OWORD:
54+
+ return "oword";
55+
+ case TY_YWORD:
56+
+ return "yword";
57+
+ case TY_ZWORD:
58+
+ return "zword";
59+
+ case TY_COMMON:
60+
+ return "common";
61+
+ case TY_SEG:
62+
+ return "seg";
63+
+ case TY_EXTERN:
64+
+ return "extern";
65+
+ case TY_EQU:
66+
+ return "equ";
67+
+ default:
68+
+ return "<invalid type code>";
69+
+ }
70+
+}
71+
+
72+
static void dbgdbg_init(void)
73+
{
74+
fprintf(ofile, "dbg init: debug information enabled\n");
75+
@@ -457,7 +492,7 @@ static void dbgdbg_output(int output_type, void *param)
76+
static void dbgdbg_typevalue(int32_t type)
77+
{
78+
fprintf(ofile, "dbg typevalue: %s(%"PRIX32")\n",
79+
- types[TYM_TYPE(type) >> 3], TYM_ELEMENTS(type));
80+
+ type_name(type), TYM_ELEMENTS(type));
81+
}
82+
83+
static void
84+
--
85+
2.45.4
86+

SPECS/nasm/nasm.spec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
Summary: Netwide Assembler.
22
Name: nasm
33
Version: 2.16
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: BSD
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
Group: System Environment/Libraries
99
URL: https://www.nasm.us
1010
Source0: http://www.nasm.us/pub/nasm/releasebuilds/%{version}/%{name}-%{version}.tar.gz
11+
Patch0: CVE-2022-46456.patch
12+
13+
BuildRequires: perl
14+
BuildRequires: perl(File::Find)
15+
1116
ExclusiveArch: x86_64
1217

1318
%description
1419
NASM (Netwide Assembler) is an 80x86 assembler designed for portability and modularity. It includes a disassembler as well.
1520

1621
%prep
17-
%setup -q
22+
%autosetup -p1
1823

1924
%build
2025
%configure
@@ -33,6 +38,9 @@ make %{?_smp_mflags} -k test
3338
%{_datadir}/*
3439

3540
%changelog
41+
* Tue Mar 17 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.16-2
42+
- Patch for CVE-2022-46456
43+
3644
* Tue May 23 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 2.16-1
3745
- Auto-upgrade to 2.16 - patch CVE-2022-44370
3846

0 commit comments

Comments
 (0)