aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/io.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-25 16:31:40 +0200
committerMarvin Borner2021-04-25 16:31:40 +0200
commit0fe14a1ff936c38ab9aa7f85219d0c155d276823 (patch)
treeb3e4b1f9000819a564656fabf0496f871c1e6eba /kernel/features/io.c
parentf2b4acb2fe6a366288b19843e0d2678b8590bdf4 (diff)
Added range-based memory validator
Diffstat (limited to 'kernel/features/io.c')
-rw-r--r--kernel/features/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/features/io.c b/kernel/features/io.c
index fbae5cf..d4737bf 100644
--- a/kernel/features/io.c
+++ b/kernel/features/io.c
@@ -120,7 +120,7 @@ res io_control(enum io_type io, u32 request, void *arg1, void *arg2, void *arg3)
res io_write(enum io_type io, const void *buf, u32 offset, u32 count)
{
- if (!memory_readable(buf))
+ if (!memory_readable_range(memory_range(buf, count)))
return -EFAULT;
struct io_dev *dev;
@@ -132,7 +132,7 @@ res io_write(enum io_type io, const void *buf, u32 offset, u32 count)
res io_read(enum io_type io, void *buf, u32 offset, u32 count)
{
- if (!memory_readable(buf))
+ if (!memory_writable_range(memory_range(buf, count)))
return -EFAULT;
struct io_dev *dev;