Commit 685dd5ff authored by Blaisorblade's avatar Blaisorblade Committed by Chris Wright

[PATCH] sys_get_thread_area does not clear the returned argument

CC: <stable@kernel.org>

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.

This was already committed to Linus' repository.
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
parent 60372783
...@@ -827,6 +827,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *u_info) ...@@ -827,6 +827,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
return -EINVAL; return -EINVAL;
memset(&info, 0, sizeof(info));
desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN; desc = current->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
info.entry_number = idx; info.entry_number = idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment