1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:15:07 +00:00

Kernel: Remove char* versions of path argument / kstring copy methods

The only two paths for copying strings in the kernel should be going
through the existing Userspace<char const*>, or StringArgument methods.

Lets enforce this by removing the option for using the raw cstring APIs
that were previously available.
This commit is contained in:
Brian Gianforcaro 2021-08-12 22:04:31 -07:00 committed by Andreas Kling
parent 5121e58d4a
commit 40a942d28b
6 changed files with 14 additions and 21 deletions

View file

@ -592,7 +592,8 @@ KResult IPv4Socket::ioctl(FileDescription&, unsigned request, Userspace<void*> a
if (!copy_from_user(&route, user_route))
return EFAULT;
auto ifname_or_error = try_copy_kstring_from_user(route.rt_dev, IFNAMSIZ);
Userspace<const char*> user_rt_dev((FlatPtr)route.rt_dev);
auto ifname_or_error = try_copy_kstring_from_user(user_rt_dev, IFNAMSIZ);
if (ifname_or_error.is_error())
return ifname_or_error.error();