mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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:
parent
0bb3d83a48
commit
9a04f53a0f
16 changed files with 99 additions and 93 deletions
|
@ -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&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue