Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148411839
D15683.1786713914.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1007 B
Referenced Files
None
Subscribers
None
D15683.1786713914.diff
View Options
Index: sys/kern/imgact_elf.c
===================================================================
--- sys/kern/imgact_elf.c
+++ sys/kern/imgact_elf.c
@@ -839,17 +839,12 @@
break;
case PT_INTERP:
/* Path to interpreter */
- if (phdr[i].p_filesz > MAXPATHLEN) {
- uprintf("Invalid PT_INTERP\n");
- error = ENOEXEC;
- goto ret;
- }
if (interp != NULL) {
uprintf("Multiple PT_INTERP headers\n");
error = ENOEXEC;
goto ret;
}
- interp_name_len = phdr[i].p_filesz;
+ interp_name_len = min(phdr[i].p_filesz, MAXPATHLEN);
if (phdr[i].p_offset > PAGE_SIZE ||
interp_name_len > PAGE_SIZE - phdr[i].p_offset) {
VOP_UNLOCK(imgp->vp, 0);
@@ -870,6 +865,12 @@
} else {
interp = __DECONST(char *, imgp->image_header) +
phdr[i].p_offset;
+ }
+ if (strlen(interp) >= MAXPATHLEN) {
+ uprintf("Invalid PT_INTERP (too long)\n");
+ error = ENOEXEC;
+ VOP_UNLOCK(imgp->vp, 0);
+ goto ret;
}
break;
case PT_GNU_STACK:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 14, 1:25 PM (4 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29406844
Default Alt Text
D15683.1786713914.diff (1007 B)
Attached To
Mode
D15683: Change image activator to check length of interpreter is less then MAXPATHLEN.
Attached
Detach File
Event Timeline
Log In to Comment