Kernel: Remove a bunch of no-longer-necessary SmapDisablers

We forgot to remove the automatic SMAP disablers after fixing up all
this code to not access userspace memory directly. Let's lock things
down at last. :^)
This commit is contained in:
Andreas Kling 2021-01-17 14:49:14 +01:00
parent fd441b954d
commit 1730c23775
Notes: sideshowbarker 2024-07-18 23:08:33 +09:00
5 changed files with 0 additions and 10 deletions

View file

@ -506,8 +506,6 @@ int IPv4Socket::ioctl(FileDescription&, unsigned request, FlatPtr arg)
{
REQUIRE_PROMISE(inet);
SmapDisabler disabler;
auto ioctl_route = [request, arg]() {
rtentry route;
if (!copy_from_user(&route, (rtentry*)arg))

View file

@ -48,7 +48,6 @@ int Process::sys$dbgputstr(Userspace<const u8*> characters, int length)
if (length <= 0)
return 0;
SmapDisabler disabler;
auto buffer = UserOrKernelBuffer::for_user_buffer(characters, length);
if (!buffer.has_value())
return -EFAULT;

View file

@ -39,7 +39,6 @@ ssize_t Process::sys$getrandom(Userspace<void*> buffer, size_t buffer_size, [[ma
if (buffer_size <= 0)
return -EINVAL;
SmapDisabler disabler;
auto data_buffer = UserOrKernelBuffer::for_user_buffer(buffer, buffer_size);
if (!data_buffer.has_value())
return -EFAULT;

View file

@ -39,7 +39,6 @@ int Process::sys$select(const Syscall::SC_select_params* user_params)
REQUIRE_PROMISE(stdio);
Syscall::SC_select_params params;
SmapDisabler disabler;
if (!copy_from_user(&params, user_params))
return -EFAULT;
@ -153,8 +152,6 @@ int Process::sys$poll(Userspace<const Syscall::SC_poll_params*> user_params)
if (!copy_from_user(&params, user_params))
return -EFAULT;
SmapDisabler disabler;
Thread::BlockTimeout timeout;
if (params.timeout) {
timespec timeout_copy;

View file

@ -208,7 +208,6 @@ ssize_t Process::sys$sendmsg(int sockfd, Userspace<const struct msghdr*> user_ms
auto& socket = *description->socket();
if (socket.is_shut_down_for_writing())
return -EPIPE;
SmapDisabler disabler;
auto data_buffer = UserOrKernelBuffer::for_user_buffer((u8*)iovs[0].iov_base, iovs[0].iov_len);
if (!data_buffer.has_value())
return -EFAULT;
@ -236,8 +235,6 @@ ssize_t Process::sys$recvmsg(int sockfd, Userspace<struct msghdr*> user_msg, int
Userspace<sockaddr*> user_addr((FlatPtr)msg.msg_name);
Userspace<socklen_t*> user_addr_length(msg.msg_name ? (FlatPtr)&user_msg.unsafe_userspace_ptr()->msg_namelen : 0);
SmapDisabler disabler;
auto description = file_description(sockfd);
if (!description)
return -EBADF;