From da3163d11b42fa81b2b0ae337e288d58e3649a9c Mon Sep 17 00:00:00 2001 From: Doczom Date: Sun, 9 May 2021 13:27:00 +0000 Subject: [PATCH] fixed vulnerability (reading kernel memory from userspace) in sysfn 47 git-svn-id: svn://kolibrios.org@8713 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/kernel.asm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 5b21513082..b4e6671545 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1409,6 +1409,19 @@ sys_outport: ret display_number: +; add check pointers + test bl, bl + jz @f + stdcall is_region_userspace, ecx, 1 + jnz @f + ret +@@: + test esi, 0x08000000 + jz @f + stdcall is_region_userspace, edi, 1 + jnz @f + ret +@@: ;It is not optimization mov eax, ebx mov ebx, ecx