Repository navigation
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Спасибо за ваш интерес к проекту! Извините, сейчас накопилось слишком много открытых PR. Пока мы разбираемся с ними, приём PR от новых участников - авторов, чьих коммитов ещё нет в |
Owner
|
Thank you for your interest in the project! Sorry, there are currently too many open PRs. While we sort them out, accepting PRs from new contributors—authors whose commits haven't yet made it into main—is temporarily suspended. Therefore, this PR is automatically closed. This is not a quality review of your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #1666.
A dynamic symbol's file offset was
base + index * 24, then checked withoffset + 4 > size. Both additions wrap in 64-bit arithmetic.DT_OS_SYMTABnear the top of that range therefore lands inside the input, and the four bytes there are taken asst_name. With the tag set to2^64 - 16and symbol index 1, that read hit the ELF header and the conversion failed withEmpty import symbol nameinstead of a bounds error.The lookup now rejects a base past the image, an index that does not start in the bytes that remain, and a 4-byte
st_namethat does not fit. Each test uses subtraction, so the check itself cannot wrap. This path reads onlyst_name. It does not require the other 20 bytes of an Elf64_Sym. A later pass still requires the declaredDT_OS_SYMTABSZwindow; that requirement is unchanged.#2196 bounds the same class of addition in the entry-point collector. #2331 reads a defined symbol's section index from this entry and still adds the offset before checking it.
Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0, Ninja, Release, relinker-only:
cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ONcmake --build build-relinker --parallelctest --test-dir build-relinker --output-on-failure --timeout 120 --parallel 441 tests passed, including
symbol_table_bounds. That test keeps a valid SysV table and a valid OS-tag table, accepts a 48-byte OS symbol table that ends on the last byte of the file, and rejects a base past EOF, a base of2^64 - 16, a base of2^64 - 4with symbol index 0, a symbol index past EOF, and a name field that crosses EOF. The2^64 - 16input is also rejected on the Linux output path, before that path's program-header layout runs. Before the fix, the same input exited 2 withEmpty import symbol name.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)