fix(elf): admit distribution glibc within the default note budget (#11847)

inspect_elf_notes and inspect_elf_debug_link now examine up to 128 note
entries by default instead of 32; the ceiling stays 256. Ubuntu 26.04's
libc.so.6 is examined as 85 entries, 79 of them SystemTap probes, and both
tools refused it with default arguments.
This commit is contained in:
RRFZ authored and GitHub committed 2026-11-18 09:10:47 -05:00
1 parent fceb4693fc
commit 2c9d015bb2
6 files changed
+49 -5

No files matched your search

+15
View File
@@ -664,6 +664,21 @@ it("fails when the entry budget is exhausted", () => {
).toThrow(ParseFailureError);
});
it("reads a glibc-sized note table with the default entry budget", () => {
// Ubuntu's libc.so.6 has 79 SystemTap probe notes beside its build-id, ABI
// tag and GNU property notes; this table has the first two and the probes.
const probes = Array.from({ length: 79 }, () =>
elfNote("stapsdt", 3, Buffer.alloc(40)),
);
const report = parse(
elfNoteFixture({
ownership: "section",
notes: Buffer.concat([gnuBuildIdNote(), gnuAbiTagNote(), ...probes]),
}),
);
expect(report.entries).toHaveLength(81);
});
it("keeps unsafe table offsets ahead of unsupported extended numbering", () => {
const bytes = elfExtendedSectionCountFixture();
bytes.writeBigUInt64LE(0xffffffffffffffffn, 32);