Kernel: Fix SMAP in setkeymap syscall

It looks like setkeymap was missed when
the SMAP functionality was introduced.

Disable SMAP only in the scope where we
actually read the usermode addresses.
This commit is contained in:
Brian Gianforcaro 2020-01-13 01:26:20 -08:00 committed by Andreas Kling
commit 9cac205d67
Notes: sideshowbarker 2024-07-19 10:05:37 +09:00

View file

@ -3955,6 +3955,7 @@ int Process::sys$setkeymap(const Syscall::SC_setkeymap_params* params)
if (!validate_read(altgr_map, 0x80))
return -EFAULT;
SmapDisabler disabler;
KeyboardDevice::the().set_maps(map, shift_map, alt_map, altgr_map);
return 0;
}