Skip to content

Commit

Permalink
[PATCH] sys_get_thread_area does not clear the returned argument
Browse files Browse the repository at this point in the history
sys_get_thread_area does not memset to 0 its struct user_desc info before
copying it to user space...  since sizeof(struct user_desc) is 16 while the
actual datas which are filled are only 12 bytes + 9 bits (across the
bitfields), there is a (small) information leak.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Blaisorblade authored and Linus Torvalds committed Jul 27, 2005
1 parent 44456d3 commit 71ae18e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
return -EINVAL;

memset(&info, 0, sizeof(info));

desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;

info.entry_number = idx;
Expand Down

0 comments on commit 71ae18e

Please sign in to comment.