diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-01 10:34:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-01 10:46:52 -0700 |
commit | 0083fc2c50e6c5127c2802ad323adf8143ab7856 (patch) | |
tree | 0ec735c46d8be4ae4c637243b126feba0be2ebe8 /kernel/backtracetest.c | |
parent | ed680c4ad478d0fee9740f7d029087f181346564 (diff) |
do_sigaltstack: avoid copying 'stack_t' as a structure to user space
Ulrich Drepper correctly points out that there is generally padding in
the structure on 64-bit hosts, and that copying the structure from
kernel to user space can leak information from the kernel stack in those
padding bytes.
Avoid the whole issue by just copying the three members one by one
instead, which also means that the function also can avoid the need for
a stack frame. This also happens to match how we copy the new structure
from user space, so it all even makes sense.
[ The obvious solution of adding a memset() generates horrid code, gcc
does really stupid things. ]
Reported-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/backtracetest.c')
0 files changed, 0 insertions, 0 deletions