mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
Kernel: Utilize AK::Userspace<T> in the ioctl interface
It's easy to forget the responsibility of validating and safely copying kernel parameters in code that is far away from syscalls. ioctl's are one such example, and bugs there are just as dangerous as at the root syscall level. To avoid this case, utilize the AK::Userspace<T> template in the ioctl kernel interface so that implementors have no choice but to properly validate and copy ioctl pointer arguments.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
0bb3d83a48
commit
9a04f53a0f
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Userspace.h>
|
||||
#include <Kernel/FileSystem/File.h>
|
||||
#include <Kernel/FileSystem/FileDescription.h>
|
||||
#include <Kernel/Process.h>
|
||||
@@ -34,7 +35,7 @@ KResult File::close()
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
int File::ioctl(FileDescription&, unsigned, FlatPtr)
|
||||
int File::ioctl(FileDescription&, unsigned, Userspace<void*>)
|
||||
{
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user