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/Net/IPv4Socket.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/Net/IPv4Socket.h')
-rw-r--r-- | Kernel/Net/IPv4Socket.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/IPv4Socket.h b/Kernel/Net/IPv4Socket.h index 7f025882ee..1eed0a4d09 100644 --- a/Kernel/Net/IPv4Socket.h +++ b/Kernel/Net/IPv4Socket.h @@ -46,7 +46,7 @@ public: virtual KResult setsockopt(int level, int option, Userspace<const void*>, socklen_t) override; virtual KResult getsockopt(FileDescription&, int level, int option, Userspace<void*>, Userspace<socklen_t*>) override; - virtual int ioctl(FileDescription&, unsigned request, FlatPtr arg) override; + virtual int ioctl(FileDescription&, unsigned request, Userspace<void*> arg) override; bool did_receive(const IPv4Address& peer_address, u16 peer_port, ReadonlyBytes, const Time&); |