| 제목 | GNU ld 2.43 illegal read access in yylex (ld/ldlex.l:488:26) -w -T options |
|---|
| 설명 | **Description**
A segv can occur in ld (part of binutils 2.43) when using the -w -T options with a specially crafted input file. This issue leads to memory corruption (illegal memory read access) and crashes.
**Affected Version**
GNU ld (GNU Binutils) 2.43
**Steps to Reproduce**
Build binutils 2.43 with AddressSanitizer (e.g., CFLAGS="-g -fsanitize=address" ./configure && make -j).
Run the following command:
./binutils-2.43/bins/bin/ld -w -T/ / /tmp/poc
AddressSanitizer:DEADLYSIGNAL
=================================================================
==488261==ERROR: AddressSanitizer: SEGV on unknown address 0x55a55b9fea18 (pc 0x559d5a8549b8 bp 0x7ffc2b06b790 sp 0x7ffc2b06b2d0 T0)
==488261==The signal is caused by a READ memory access.
#0 0x559d5a8549b8 in yylex ./binutils-2.43/ld/ldlex.l:488:26
#1 0x559d5a8433fa in yyparse ./binutils-2.43/ld/ldgram.c:2520:16
#2 0x559d5a8758fe in load_symbols ./binutils-2.43/ld/ldlang.c:3051:7
#3 0x559d5a886304 in open_input_bfds ./binutils-2.43/ld/ldlang.c:3622:13
#4 0x559d5a8829f3 in lang_process ./binutils-2.43/ld/ldlang.c:8194:3
#5 0x559d5a8ad34c in main ./binutils-2.43/ld/./ldmain.c:529:3
#6 0x7f1610c3f082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x559d5a7856bd in _start (./binutils-2.43/bins/bin/ld+0x15a6bd) (BuildId: d9731e405748db264b62c84ded760ba4f068cb0a)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ./binutils-2.43/ld/ldlex.l:488:26 in yylex
==488261==ABORTING
** Env **
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal |
|---|
| 원천 | ⚠️ https://sourceware.org/bugzilla/show_bug.cgi?id=32645 |
|---|
| 사용자 | rookie (UID 80861) |
|---|
| 제출 | 2025. 02. 06. AM 03:03 (2 연령 ago) |
|---|
| 모더레이션 | 2025. 02. 10. PM 12:11 (4 days later) |
|---|
| 상태 | 중복 |
|---|
| VulDB 항목 | 295057 [GNU Binutils 2.43/2.44 format.c bfd_set_format 메모리 손상] |
|---|
| 포인트들 | 0 |
|---|