mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
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:
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user