Skip to content

Commit 5f65d1d

Browse files
committed
Merge branch '0.15-maintenance' into 0.16-maintenance
2 parents f3cb303 + cac8c90 commit 5f65d1d

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

ChangeLog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ Changes from 0.15.3:
2222
(These notes are the remainder of 0.16.0 that was not backported to 0.15.3.
2323
Originally, 0.16.0 was branched from 0.15.0, and those changes were fresh in this release, having never been backported.)
2424

25+
## 0.15.5 (August 12, 2025)
26+
27+
Bugfix backports from 0.18.0:
28+
29+
* Adjust `roundUp` for 0 as input by @cgzones in https://github.com/NixOS/patchelf/pull/466
30+
31+
Bugfix backports from 0.17.{0, 1}:
32+
33+
* Fix page size constants for Itanium and SPARC.
34+
* Fix Out-of-bounds read in the function `modifySoname` by @yairKoskas in https://github.com/NixOS/patchelf/pull/451
35+
2536
## 0.15.4 (August 12, 2025)
2637

2738
* Update to a later glibc `elf.h`.

src/patchelf.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,18 @@ unsigned int ElfFile<ElfFileParamNames>::getPageSize() const noexcept
322322
// requirements. There is no authoritative list of these values. The
323323
// current list is extracted from GNU gold's source code (abi_pagesize).
324324
switch (rdi(hdr()->e_machine)) {
325-
case EM_SPARC:
325+
case EM_IA_64:
326326
case EM_MIPS:
327327
case EM_PPC:
328328
case EM_PPC64:
329329
case EM_AARCH64:
330330
case EM_TILEGX:
331331
case EM_LOONGARCH:
332332
return 0x10000;
333+
case EM_SPARC: // This should be sparc 32-bit. According to the linux
334+
// kernel 4KB should be also fine, but it seems that solaris is doing 8KB
335+
case EM_SPARCV9: /* SPARC64 support */
336+
return 0x2000;
333337
default:
334338
return 0x1000;
335339
}
@@ -431,6 +435,8 @@ static void writeFile(const std::string & fileName, const FileContents & content
431435

432436
static uint64_t roundUp(uint64_t n, uint64_t m)
433437
{
438+
if (n == 0)
439+
return m;
434440
return ((n - 1) / m + 1) * m;
435441
}
436442

@@ -1262,6 +1268,7 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const std::string &
12621268
if (rdi(dyn->d_tag) == DT_SONAME) {
12631269
dynSoname = dyn;
12641270
soname = strTab + rdi(dyn->d_un.d_val);
1271+
checkPointer(fileContents, strTab, rdi(dyn->d_un.d_val));
12651272
}
12661273
}
12671274

tests/set-rpath-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SCRATCH=scratch/$(basename "$0" .sh)
33

44
if test "$(uname)" = FreeBSD; then
55
echo "skipping on FreeBSD"
6-
exit 0
6+
exit 77
77
fi
88

99
rm -rf "${SCRATCH}"

tests/set-rpath-rel-map.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OBJCOPY=${OBJCOPY:-objcopy}
66

77
if ! $OBJDUMP -p main | grep -q MIPS_RLD_MAP_REL; then
88
echo "No MIPS_RLD_MAP_REL dynamic section entry, skipping"
9-
exit 0
9+
exit 77
1010
fi
1111

1212
rm -rf "${SCRATCH}"

0 commit comments

Comments
 (0)