sys_get_thread_area does not clear the returned argument
PATCH 1/1 sys_get_thread_area does not clear the returned argument
From: Blaisorblade <[email protected]>
CC: <[email protected]>
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.
---
vanilla-linux-2.6.12-paolo/arch/i386/kernel/process.c | 2 ++ 1 files changed, 2 insertions(+)
arch/i386/kernel/process.c renamed from arch/i386/kernel/process.c~sec-micro-info-leak +2 -0
@@ -827,6 +827,8 @@ asmlinkage int sys_get_thread_area(strucif (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;
_
Quoted 10 lines · * [email protected] ([email protected]) wrote:
From: Blaisorblade <[email protected]>
CC: <[email protected]>
sys_get_thread_areadoes not memset to 0 its structuser_descinfo before copying it to user space... sincesizeof(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.
Thanks, queued to -stable.
-chris