tty: extra hang up checks

This commit is contained in:
Matheus
2025-12-25 20:20:34 -03:00
parent 91a5266d29
commit a9dee251c9
6 changed files with 24 additions and 6 deletions
+4 -1
View File
@@ -8,7 +8,10 @@ syscallret_t syscall_ioctl(context_t *, int fd, unsigned long request, void *arg
.ret = -1
};
if (IS_USER_ADDRESS(arg) == false) {
// arg could be null for, say, an ioctl that does not pass an argument
// this is safe as any accesses on ioctls are done through user copy, which
// returns EFAULT on a null access
if (arg != NULL && IS_USER_ADDRESS(arg) == false) {
ret.errno = EFAULT;
return ret;
}