public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb98644
)
usermem: fix dumb error where some out of range addresses were not errorred
author
Alan Cox
<alan@linux.intel.com>
Sat, 19 Jan 2019 19:14:56 +0000
(19:14 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Sat, 19 Jan 2019 19:14:56 +0000
(19:14 +0000)
Kernel/usermem.c
patch
|
blob
|
history
diff --git
a/Kernel/usermem.c
b/Kernel/usermem.c
index
6a96664
..
4490247
100644
(file)
--- a/
Kernel/usermem.c
+++ b/
Kernel/usermem.c
@@
-16,7
+16,8
@@
/* This checks to see if a user-supplied address is legitimate */
usize_t valaddr(const char *base, usize_t size)
{
- if (!base || base < (const char *)PROGBASE || base + size < base)
+ if (!base || base < (const char *)PROGBASE || base + size < base ||
+ base > (const char *)(size_t)udata.u_top)
size = 0;
else if (base + size > (const char *)(size_t)udata.u_top)
size = (char *)(size_t)udata.u_top - base;