proper bounds check in do_set_gdt entry point
PATCH 1/1 proper bounds check in do_set_gdt entry point
Unless I missed something, not bounds checking entries in do_set_gdt is a security hole.
xen/arch/x86/mm.c +3 -0
@@ -2442,6 +2442,9 @@ long do_set_gdt(unsigned long *frame_lisunsigned long frames[16 ];long ret; +if ( entries >FIRST_RESERVED_GDT_ENTRY ) +return -EINVAL ; +if (copy_from_user (frames, frame_list, nr_pages *sizeof (unsigned long )) )return -EFAULT ;
Quoted 4 lines · Chris Wright
Unless I missed something, not bounds checking entries in
do_set_gdtis a security hole.Signed-off-by Chris Wright <[email protected]>
The check happens in set_gdt(). do_set_gdt is just a wrapper with a copy_from_user plus conditional tlb flush.
-- Keir
Quoted 10 lines · * Keir Fraser ([email protected]) wrote:
Quoted 4 lines · Chris Wright
Unless I missed something, not bounds checking entries in
do_set_gdtis a security hole.Signed-off-by Chris Wright <[email protected]>The check happens in
set_gdt().do_set_gdtis just a wrapper with acopy_from_userplus conditional tlb flush.
I know, but copy_from_user has no sane limits. This is stack smash. -chris
Quoted 5 lines · Chris Wright
Quoted 2 lines
The check happens in
set_gdt().do_set_gdtis just a wrapper with acopy_from_userplus conditional tlb flush.I know, but
copy_from_userhas no sane limits. This is stack smash. -chris
Good point.
-- Keir