From a18d8020641d28fe40b43e9ff20652a8a6a6a4d0 Mon Sep 17 00:00:00 2001 From: Doczom Date: Sun, 9 May 2021 09:14:43 +0000 Subject: [PATCH] fixed vulnerability (reading kernel memory from userspace) in sysfn 54.2 git-svn-id: svn://kolibrios.org@8711 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/clipboard.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/trunk/core/clipboard.inc b/kernel/trunk/core/clipboard.inc index 1d023d5528..99f1fa4aca 100644 --- a/kernel/trunk/core/clipboard.inc +++ b/kernel/trunk/core/clipboard.inc @@ -49,6 +49,15 @@ align 4 .2: dec ebx ; 2 - Write the data to the clipboard jnz .3 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + stdcall is_region_userspace, edx, ecx + jnz @f + mov eax, -1 + jmp .exit_1 +@@: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; check the lock mov ebx, clipboard_write_lock xor eax, eax