mknodat: refuse to create symlinks

The current mknodat code creates symlinks when requested. Not only does
this break POSIX, it also causes a kernel crash (NULL-deref on
tmpfs_readlink).

Refuse to create symlinks with mknodat.

Found by syzkaller fuzzing.
This commit is contained in:
Matheus
2026-10-09 02:10:12 -03:00
parent ac6addd527
commit 47ce33935f
+5
View File
@@ -34,6 +34,11 @@ syscallret_t syscall_mknodat(context_t *, int dirfd, char *upath, mode_t mode, d
goto cleanup; goto cleanup;
int type = vfs_getsystemtype(GETTYPE(mode)); int type = vfs_getsystemtype(GETTYPE(mode));
if (type == V_TYPE_LINK) {
ret.errno = EINVAL;
goto cleanup;
}
mode = GETMODE(mode); mode = GETMODE(mode);
vattr_t attr = { vattr_t attr = {