From 9a04f53a0fcb8d6c3d449ca89f7fdbb83db68dd5 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 26 Jul 2021 02:47:00 -0700 Subject: Kernel: Utilize AK::Userspace 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 template in the ioctl kernel interface so that implementors have no choice but to properly validate and copy ioctl pointer arguments. --- Kernel/TTY/TTY.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel/TTY/TTY.h') 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 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 arg) override final; virtual String absolute_path(const FileDescription&) const override { return tty_name(); } virtual String const& tty_name() const = 0; -- cgit v1.2.3