Compare commits

...

2 Commits

2 changed files with 5 additions and 1 deletions

View File

@@ -4,6 +4,6 @@
kern_status_t sys_kern_log(const char *s) kern_status_t sys_kern_log(const char *s)
{ {
struct task *task = current_task(); struct task *task = current_task();
printk("%s: %s", task->t_name, task->t_id, s); printk("%s[%d]: %s", task->t_name, task->t_id, s);
return KERN_OK; return KERN_OK;
} }

View File

@@ -165,6 +165,10 @@ static bool validate_iovec(
size_t count, size_t count,
bool rw) bool rw)
{ {
if (!validate_access_r(task, iov, count * sizeof(struct iovec))) {
return false;
}
for (size_t i = 0; i < count; i++) { for (size_t i = 0; i < count; i++) {
bool ok = false; bool ok = false;
const struct iovec *vec = &iov[i]; const struct iovec *vec = &iov[i];