Page MenuHomeFreeBSD

D60937.1795818604.diff
No OneTemporary

Authored By
Unknown
Size
949 B
Referenced Files
None
Subscribers
None

D60937.1795818604.diff

diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
--- a/sys/kern/link_elf_obj.c
+++ b/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

Mime Type
text/plain
Expires
Fri, Nov 27, 10:30 PM (18 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41267830
Default Alt Text
D60937.1795818604.diff (949 B)

Event Timeline