diff options
author | rtm <rtm> | 2006-07-18 19:22:37 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-07-18 19:22:37 +0000 |
commit | bd228a81566befa6154807d327d8c873f6a76c79 (patch) | |
tree | 5e514950688f29a3150ec9c43c478c8208435c87 /syscall.c | |
parent | 0dd4253747eef56d0f1539fac7d62234f6af5f51 (diff) | |
download | xv6-labs-bd228a81566befa6154807d327d8c873f6a76c79.tar.gz xv6-labs-bd228a81566befa6154807d327d8c873f6a76c79.tar.bz2 xv6-labs-bd228a81566befa6154807d327d8c873f6a76c79.zip |
prevent longjmp / forkret from writing over tf->edi
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -13,8 +13,7 @@ * System call number in %eax. * Arguments on the stack, from the user call to the C * library system call function. The saved user %esp points - * to a saved frame pointer, a program counter, and then - * the first argument. + * to a saved program counter, and then the first argument. * * Return value? Error indication? Errno? */ @@ -56,11 +55,11 @@ fetcharg(int argno, void *ip) } int -putint(struct proc *p, uint addr, int ip) +putint(struct proc *p, uint addr, int x) { if(addr > p->sz - 4) return -1; - memmove(p->mem + addr, &ip, 4); + memmove(p->mem + addr, &x, 4); return 0; } @@ -269,7 +268,6 @@ syscall(void) int num = cp->tf->eax; int ret = -1; - //cprintf("%x sys %d\n", cp, num); switch(num){ case SYS_fork: ret = sys_fork(); |