Commit 1d16757
userspace: Additional checks in K_SYSCALL_MEMORY
This macros needed additional checks before invoking
arch_buffer_validate.
- size can not be less then 0. Some functions invoke this macro
using signed type which will be promote to unsigned when invoking
arch_buffer_validate. We need to do an early check.
- We need to check for possible overflow, since a malicious user
application could use a negative number that would be promoted
to a big value that would cause a integer overflow when adding it
to the buffer address, leading to invalid checks.
Signed-off-by: Flavio Ceolin <[email protected]>1 parent eeefd07 commit 1d16757
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
0 commit comments