Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150567191
D24446.id70663.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D24446.id70663.diff
View Options
Index: head/sys/amd64/linux/linux_sysvec.c
===================================================================
--- head/sys/amd64/linux/linux_sysvec.c
+++ head/sys/amd64/linux/linux_sysvec.c
@@ -254,9 +254,9 @@
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid);
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
- AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
- AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -315,8 +315,8 @@
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(void *));
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -324,8 +324,8 @@
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(void *));
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
Index: head/sys/amd64/linux32/linux32_sysvec.c
===================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c
+++ head/sys/amd64/linux32/linux32_sysvec.c
@@ -742,8 +742,8 @@
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(uint32_t));
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -751,8 +751,8 @@
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(uint32_t));
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
Index: head/sys/arm64/linux/linux_sysvec.c
===================================================================
--- head/sys/arm64/linux/linux_sysvec.c
+++ head/sys/arm64/linux/linux_sysvec.c
@@ -180,9 +180,9 @@
#if 0 /* LINUXTODO: implement arm64 LINUX_AT_PLATFORM */
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform));
#endif
- AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
- AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -236,8 +236,8 @@
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(void *));
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -245,8 +245,8 @@
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(void *));
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
Index: head/sys/compat/freebsd32/freebsd32_misc.c
===================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c
+++ head/sys/compat/freebsd32/freebsd32_misc.c
@@ -3161,8 +3161,8 @@
*/
if (execpath_len != 0) {
destp -= execpath_len;
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -3172,8 +3172,8 @@
*/
arc4rand(canary, sizeof(canary), 0);
destp -= sizeof(canary);
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
imgp->canarylen = sizeof(canary);
@@ -3185,8 +3185,8 @@
pagesizes32[i] = (uint32_t)pagesizes[i];
destp -= sizeof(pagesizes32);
destp = rounddown2(destp, sizeof(uint32_t));
- imgp->pagesizes = destp;
- error = copyout(pagesizes32, (void *)destp, sizeof(pagesizes32));
+ imgp->pagesizes = (void *)destp;
+ error = copyout(pagesizes32, imgp->pagesizes, sizeof(pagesizes32));
if (error != 0)
return (error);
imgp->pagesizeslen = sizeof(pagesizes32);
Index: head/sys/i386/linux/linux_sysvec.c
===================================================================
--- head/sys/i386/linux/linux_sysvec.c
+++ head/sys/i386/linux/linux_sysvec.c
@@ -237,9 +237,9 @@
AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid);
AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid);
AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(uplatform));
- AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary);
if (imgp->execpathp != 0)
- AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, imgp->execpathp);
+ AUXARGS_ENTRY_PTR(pos, LINUX_AT_EXECFN, imgp->execpathp);
if (args->execfd != -1)
AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
AUXARGS_ENTRY(pos, AT_NULL, 0);
@@ -301,8 +301,8 @@
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(void *));
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -310,8 +310,8 @@
/* Prepare the canary for SSP. */
arc4rand(canary, sizeof(canary), 0);
destp -= roundup(sizeof(canary), sizeof(void *));
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
Index: head/sys/kern/imgact_elf.c
===================================================================
--- head/sys/kern/imgact_elf.c
+++ head/sys/kern/imgact_elf.c
@@ -1349,16 +1349,16 @@
AUXARGS_ENTRY(pos, AT_BASE, args->base);
AUXARGS_ENTRY(pos, AT_EHDRFLAGS, args->hdr_eflags);
if (imgp->execpathp != 0)
- AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);
+ AUXARGS_ENTRY_PTR(pos, AT_EXECPATH, imgp->execpathp);
AUXARGS_ENTRY(pos, AT_OSRELDATE,
imgp->proc->p_ucred->cr_prison->pr_osreldate);
if (imgp->canary != 0) {
- AUXARGS_ENTRY(pos, AT_CANARY, imgp->canary);
+ AUXARGS_ENTRY_PTR(pos, AT_CANARY, imgp->canary);
AUXARGS_ENTRY(pos, AT_CANARYLEN, imgp->canarylen);
}
AUXARGS_ENTRY(pos, AT_NCPUS, mp_ncpus);
if (imgp->pagesizes != 0) {
- AUXARGS_ENTRY(pos, AT_PAGESIZES, imgp->pagesizes);
+ AUXARGS_ENTRY_PTR(pos, AT_PAGESIZES, imgp->pagesizes);
AUXARGS_ENTRY(pos, AT_PAGESIZESLEN, imgp->pagesizeslen);
}
if (imgp->sysent->sv_timekeep_base != 0) {
Index: head/sys/kern/kern_exec.c
===================================================================
--- head/sys/kern/kern_exec.c
+++ head/sys/kern/kern_exec.c
@@ -1571,8 +1571,8 @@
if (execpath_len != 0) {
destp -= execpath_len;
destp = rounddown2(destp, sizeof(void *));
- imgp->execpathp = destp;
- error = copyout(imgp->execpath, (void *)destp, execpath_len);
+ imgp->execpathp = (void *)destp;
+ error = copyout(imgp->execpath, imgp->execpathp, execpath_len);
if (error != 0)
return (error);
}
@@ -1582,8 +1582,8 @@
*/
arc4rand(canary, sizeof(canary), 0);
destp -= sizeof(canary);
- imgp->canary = destp;
- error = copyout(canary, (void *)destp, sizeof(canary));
+ imgp->canary = (void *)destp;
+ error = copyout(canary, imgp->canary, sizeof(canary));
if (error != 0)
return (error);
imgp->canarylen = sizeof(canary);
@@ -1593,8 +1593,8 @@
*/
destp -= szps;
destp = rounddown2(destp, sizeof(void *));
- imgp->pagesizes = destp;
- error = copyout(pagesizes, (void *)destp, szps);
+ imgp->pagesizes = (void *)destp;
+ error = copyout(pagesizes, imgp->pagesizes, szps);
if (error != 0)
return (error);
imgp->pagesizeslen = szps;
Index: head/sys/powerpc/powerpc/elf_common.c
===================================================================
--- head/sys/powerpc/powerpc/elf_common.c
+++ head/sys/powerpc/powerpc/elf_common.c
@@ -54,16 +54,16 @@
AUXARGS_ENTRY(pos, AT_OLD_BASE, args->base);
AUXARGS_ENTRY(pos, AT_OLD_EHDRFLAGS, args->hdr_eflags);
if (imgp->execpathp != 0)
- AUXARGS_ENTRY(pos, AT_OLD_EXECPATH, imgp->execpathp);
+ AUXARGS_ENTRY_PTR(pos, AT_OLD_EXECPATH, imgp->execpathp);
AUXARGS_ENTRY(pos, AT_OLD_OSRELDATE,
imgp->proc->p_ucred->cr_prison->pr_osreldate);
if (imgp->canary != 0) {
- AUXARGS_ENTRY(pos, AT_OLD_CANARY, imgp->canary);
+ AUXARGS_ENTRY_PTR(pos, AT_OLD_CANARY, imgp->canary);
AUXARGS_ENTRY(pos, AT_OLD_CANARYLEN, imgp->canarylen);
}
AUXARGS_ENTRY(pos, AT_OLD_NCPUS, mp_ncpus);
if (imgp->pagesizes != 0) {
- AUXARGS_ENTRY(pos, AT_OLD_PAGESIZES, imgp->pagesizes);
+ AUXARGS_ENTRY_PTR(pos, AT_OLD_PAGESIZES, imgp->pagesizes);
AUXARGS_ENTRY(pos, AT_OLD_PAGESIZESLEN, imgp->pagesizeslen);
}
if (imgp->sysent->sv_timekeep_base != 0) {
Index: head/sys/sys/imgact.h
===================================================================
--- head/sys/sys/imgact.h
+++ head/sys/sys/imgact.h
@@ -81,11 +81,11 @@
void *argv; /* pointer to argv (user space) */
void *envv; /* pointer to envv (user space) */
char *execpath;
- unsigned long execpathp;
+ void *execpathp;
char *freepath;
- unsigned long canary;
+ void *canary;
int canarylen;
- unsigned long pagesizes;
+ void *pagesizes;
int pagesizeslen;
vm_prot_t stack_prot;
u_long stack_sz;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 10:42 AM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30754035
Default Alt Text
D24446.id70663.diff (10 KB)
Attached To
Mode
D24446: Convert canary, execpathp, and pagesizes to pointers.
Attached
Detach File
Event Timeline
Log In to Comment