Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176839975
D60937.1793468280.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
980 B
Referenced Files
None
Subscribers
None
D60937.1793468280.diff
View Options
Index: sys/kern/link_elf_obj.c
===================================================================
--- sys/kern/link_elf_obj.c
+++ sys/kern/link_elf_obj.c
@@ -397,6 +397,14 @@
symtabindex = -1;
symstrindex = -1;
for (i = 0; i < hdr->e_shnum; i++) {
+ if ((shdr[i].sh_type == SHT_REL ||
+ shdr[i].sh_type == SHT_RELA) &&
+ shdr[i].sh_info >= hdr->e_shnum) {
+ link_elf_error(filename,
+ "file has an invalid relocation section");
+ error = ENOEXEC;
+ goto out;
+ }
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
@@ -836,6 +844,14 @@
for (i = 0; i < hdr->e_shnum; i++) {
if (shdr[i].sh_size == 0)
continue;
+ if ((shdr[i].sh_type == SHT_REL ||
+ shdr[i].sh_type == SHT_RELA) &&
+ shdr[i].sh_info >= hdr->e_shnum) {
+ link_elf_error(filename,
+ "file has an invalid relocation section");
+ error = ENOEXEC;
+ goto out;
+ }
switch (shdr[i].sh_type) {
case SHT_PROGBITS:
case SHT_NOBITS:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 31, 5:38 PM (10 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41267833
Default Alt Text
D60937.1793468280.diff (980 B)
Attached To
Mode
D60937: link_elf_obj: bounds-check a relocation section's sh_info
Attached
Detach File
Event Timeline