Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176836695
D60937.1793456140.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60937.1793456140.diff
View Options
Index: sys/kern/link_elf_obj.c
===================================================================
--- sys/kern/link_elf_obj.c
+++ sys/kern/link_elf_obj.c
@@ -419,12 +419,14 @@
* Ignore relocation tables for sections not
* loaded by the loader.
*/
- if (shdr[shdr[i].sh_info].sh_addr == 0)
+ if (shdr[i].sh_info >= hdr->e_shnum ||
+ shdr[shdr[i].sh_info].sh_addr == 0)
break;
ef->nreltab++;
break;
case SHT_RELA:
- if (shdr[shdr[i].sh_info].sh_addr == 0)
+ if (shdr[i].sh_info >= hdr->e_shnum ||
+ shdr[shdr[i].sh_info].sh_addr == 0)
break;
ef->nrelatab++;
break;
@@ -586,7 +588,8 @@
pb++;
break;
case SHT_REL:
- if (shdr[shdr[i].sh_info].sh_addr == 0)
+ if (shdr[i].sh_info >= hdr->e_shnum ||
+ shdr[shdr[i].sh_info].sh_addr == 0)
break;
ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr;
ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel);
@@ -594,7 +597,8 @@
rl++;
break;
case SHT_RELA:
- if (shdr[shdr[i].sh_info].sh_addr == 0)
+ if (shdr[i].sh_info >= hdr->e_shnum ||
+ shdr[shdr[i].sh_info].sh_addr == 0)
break;
ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr;
ef->relatab[ra].nrela =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 31, 2:15 PM (7 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41246646
Default Alt Text
D60937.1793456140.diff (1 KB)
Attached To
Mode
D60937: link_elf_obj: bounds-check a relocation section's sh_info
Attached
Detach File
Event Timeline