Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156173
b: refs/heads/master
c: 0083fc2
h: refs/heads/master
i:
  156171: 307e8cd
v: v3
  • Loading branch information
Linus Torvalds committed Aug 1, 2009
1 parent eca1372 commit 95785a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed680c4ad478d0fee9740f7d029087f181346564
refs/heads/master: 0083fc2c50e6c5127c2802ad323adf8143ab7856
15 changes: 8 additions & 7 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2454,11 +2454,9 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
stack_t oss;
int error;

if (uoss) {
oss.ss_sp = (void __user *) current->sas_ss_sp;
oss.ss_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp);
}
oss.ss_sp = (void __user *) current->sas_ss_sp;
oss.ss_size = current->sas_ss_size;
oss.ss_flags = sas_ss_flags(sp);

if (uss) {
void __user *ss_sp;
Expand Down Expand Up @@ -2501,13 +2499,16 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
current->sas_ss_size = ss_size;
}

error = 0;
if (uoss) {
error = -EFAULT;
if (copy_to_user(uoss, &oss, sizeof(oss)))
if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
goto out;
error = __put_user(oss.ss_sp, &uoss->ss_sp) |
__put_user(oss.ss_size, &uoss->ss_size) |
__put_user(oss.ss_flags, &uoss->ss_flags);
}

error = 0;
out:
return error;
}
Expand Down

0 comments on commit 95785a6

Please sign in to comment.