diff options
| author | Deepthi Hemraj <Deepthi.Hemraj@windriver.com> | 2024-02-05 04:29:17 -0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-02-09 03:46:50 -1000 |
| commit | 1398a0e07ff98a8c1e49066ba32d039a631a6f99 (patch) | |
| tree | 86a7016fe1c6bfcf9d1251579e66ff41cf845e40 /meta/recipes-devtools/binutils | |
| parent | 817f0e1f8957d2b1db2a01e0fe1abab6ac4bb782 (diff) | |
| download | poky-1398a0e07ff98a8c1e49066ba32d039a631a6f99.tar.gz | |
binutils: internal gdb: Fix CVE-2023-39129
CVE: CVE-2023-39129
(From OE-Core rev: fd3f20e1e8bcd63b75e8800fe60d6194a4fd6bd4)
Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/binutils')
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.38.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/0035-CVE-2023-39129.patch | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc b/meta/recipes-devtools/binutils/binutils-2.38.inc index 3787063cba..83dff20855 100644 --- a/meta/recipes-devtools/binutils/binutils-2.38.inc +++ b/meta/recipes-devtools/binutils/binutils-2.38.inc | |||
| @@ -69,5 +69,6 @@ SRC_URI = "\ | |||
| 69 | file://0032-CVE-2022-47010.patch \ | 69 | file://0032-CVE-2022-47010.patch \ |
| 70 | file://0033-CVE-2022-47007.patch \ | 70 | file://0033-CVE-2022-47007.patch \ |
| 71 | file://0034-CVE-2022-48064.patch \ | 71 | file://0034-CVE-2022-48064.patch \ |
| 72 | file://0035-CVE-2023-39129.patch \ | ||
| 72 | " | 73 | " |
| 73 | S = "${WORKDIR}/git" | 74 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-devtools/binutils/binutils/0035-CVE-2023-39129.patch b/meta/recipes-devtools/binutils/binutils/0035-CVE-2023-39129.patch new file mode 100644 index 0000000000..63fb44d59a --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0035-CVE-2023-39129.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From: Keith Seitz <keiths@...> | ||
| 2 | Date: Wed, 2 Aug 2023 15:35:11 +0000 (-0700) | ||
| 3 | Subject: Verify COFF symbol stringtab offset | ||
| 4 | X-Git-Tag: gdb-14-branchpoint~473 | ||
| 5 | X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=58abdf887821a5da09ba184c6e400a3bc5cccd5a | ||
| 6 | |||
| 7 | Verify COFF symbol stringtab offset | ||
| 8 | |||
| 9 | This patch addresses an issue with malformed/fuzzed debug information that | ||
| 10 | was recently reported in gdb/30639. That bug specifically deals with | ||
| 11 | an ASAN issue, but the reproducer provided by the reporter causes a | ||
| 12 | another failure outside of ASAN: | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=58abdf887821a5da09ba184c6e400a3bc5cccd5a] | ||
| 15 | |||
| 16 | CVE: CVE-2023-39129 | ||
| 17 | |||
| 18 | Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com> | ||
| 19 | |||
| 20 | diff --git a/gdb/coffread.c b/gdb/coffread.c | ||
| 21 | --- a/gdb/coffread.c | ||
| 22 | +++ b/gdb/coffread.c | ||
| 23 | @@ -159,6 +160,7 @@ static file_ptr linetab_offset; | ||
| 24 | static file_ptr linetab_size; | ||
| 25 | |||
| 26 | static char *stringtab = NULL; | ||
| 27 | +static long stringtab_length = 0; | ||
| 28 | |||
| 29 | extern void stabsread_clear_cache (void); | ||
| 30 | |||
| 31 | @@ -1303,6 +1298,7 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr<char> *stora | ||
| 32 | /* This is in target format (probably not very useful, and not | ||
| 33 | currently used), not host format. */ | ||
| 34 | memcpy (stringtab, lengthbuf, sizeof lengthbuf); | ||
| 35 | + stringtab_length = length; | ||
| 36 | if (length == sizeof length) /* Empty table -- just the count. */ | ||
| 37 | return 0; | ||
| 38 | |||
| 39 | @@ -1322,8 +1318,9 @@ getsymname (struct internal_syment *symbol_entry) | ||
| 40 | |||
| 41 | if (symbol_entry->_n._n_n._n_zeroes == 0) | ||
| 42 | { | ||
| 43 | - /* FIXME: Probably should be detecting corrupt symbol files by | ||
| 44 | - seeing whether offset points to within the stringtab. */ | ||
| 45 | + if (symbol_entry->_n._n_n._n_offset > stringtab_length) | ||
| 46 | + error (_("COFF Error: string table offset (%ld) outside string table (length %ld)"), | ||
| 47 | + symbol_entry->_n._n_n._n_offset, stringtab_length); | ||
| 48 | result = stringtab + symbol_entry->_n._n_n._n_offset; | ||
| 49 | } | ||
| 50 | else | ||
