diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-07-26 02:47:00 -0700 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-27 01:23:37 +0430 |
commit | 9a04f53a0fcb8d6c3d449ca89f7fdbb83db68dd5 (patch) | |
tree | d08a0d7bf73c1b8523f8a98da70ad3eb6b995570 /Kernel/TTY/TTY.h | |
parent | 0bb3d83a482e79fe5b9f4a8687b83c95da01d31d (diff) | |
download | serenity-9a04f53a0fcb8d6c3d449ca89f7fdbb83db68dd5.zip |
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.
Diffstat (limited to 'Kernel/TTY/TTY.h')
-rw-r--r-- | Kernel/TTY/TTY.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/TTY/TTY.h b/Kernel/TTY/TTY.h index 20c70a0343..6d611b3332 100644 --- a/Kernel/TTY/TTY.h +++ b/Kernel/TTY/TTY.h @@ -25,7 +25,7 @@ public: virtual KResultOr<size_t> write(FileDescription&, u64, const UserOrKernelBuffer&, size_t) override; virtual bool can_read(const FileDescription&, size_t) const override; virtual bool can_write(const FileDescription&, size_t) const override; - virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override final; + virtual int ioctl(FileDescription&, unsigned request, Userspace<void*> arg) override final; virtual String absolute_path(const FileDescription&) const override { return tty_name(); } virtual String const& tty_name() const = 0; |