mirror of
https://github.com/drasko/codezero.git
synced 2026-10-15 08:07:00 +02:00
Towards user buffer checking
This commit is contained in:
@@ -114,9 +114,9 @@ embedded devices. Most of them are proprietary, with their own users. Some of
|
|||||||
them are structurally too simplistic, and lack modern features such as paging.
|
them are structurally too simplistic, and lack modern features such as paging.
|
||||||
There ones that are well established, but Codezero will contrast them by
|
There ones that are well established, but Codezero will contrast them by
|
||||||
providing an alternative that will follow the open source development principles
|
providing an alternative that will follow the open source development principles
|
||||||
more closely. Many embedded software projects still use older development
|
more closely. Many embedded software projects still use older or closed
|
||||||
methods and the right open source methodology would prove favorable in the
|
development methods and the right open source methodology would prove favorable
|
||||||
fast-paced nature of embedded software development.
|
in the fast-paced nature of embedded software development.
|
||||||
|
|
||||||
Finally, POSIX compliance is only a step, or a temporary aim for the Codezero
|
Finally, POSIX compliance is only a step, or a temporary aim for the Codezero
|
||||||
microkernel. It is not limited to the goal of just complying with POSIX, which
|
microkernel. It is not limited to the goal of just complying with POSIX, which
|
||||||
|
|||||||
@@ -16,15 +16,28 @@ shmdt
|
|||||||
mmap
|
mmap
|
||||||
munmap
|
munmap
|
||||||
read
|
read
|
||||||
|
readdir
|
||||||
write
|
write
|
||||||
lseek
|
lseek
|
||||||
open
|
open
|
||||||
close
|
close
|
||||||
creat
|
creat
|
||||||
|
mkdir
|
||||||
|
mknod
|
||||||
|
link
|
||||||
unlink
|
unlink
|
||||||
fork
|
fork
|
||||||
execve
|
execve
|
||||||
getpid
|
getpid
|
||||||
|
wait
|
||||||
|
kill
|
||||||
|
|
||||||
|
Others:
|
||||||
|
pipe
|
||||||
|
mount
|
||||||
|
unmount
|
||||||
|
swapon
|
||||||
|
|
||||||
|
|
||||||
New ones will be added as needed.
|
New ones will be added as needed.
|
||||||
|
|
||||||
|
|||||||
@@ -412,6 +412,11 @@ int sys_write(l4id_t sender, int fd, void *buf, int count)
|
|||||||
|
|
||||||
BUG_ON(!(t = find_task(sender)));
|
BUG_ON(!(t = find_task(sender)));
|
||||||
|
|
||||||
|
if ((err = check_access(t, buf, count)) < 0) {
|
||||||
|
l4_ipc_return(err);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: Check user buffer, count and fd validity */
|
/* TODO: Check user buffer, count and fd validity */
|
||||||
if (fd < 0 || fd > TASK_FILES_MAX) {
|
if (fd < 0 || fd > TASK_FILES_MAX) {
|
||||||
l4_ipc_return(-EBADF);
|
l4_ipc_return(-EBADF);
|
||||||
|
|||||||
Reference in New Issue
Block a user