From 715be9f1dee46600551516d4428fb708ced0ee3a Mon Sep 17 00:00:00 2001 From: Pedro Falcato Date: Mon, 1 Jul 2024 00:22:12 +0100 Subject: [PATCH] namei: Fix mknod Fix mknod. We were accidentally doing the S_BADFMT check wrong. Signed-off-by: Pedro Falcato --- kernel/kernel/fs/namei.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kernel/fs/namei.cpp b/kernel/kernel/fs/namei.cpp index b3be70582..7eb640c4b 100644 --- a/kernel/kernel/fs/namei.cpp +++ b/kernel/kernel/fs/namei.cpp @@ -861,7 +861,7 @@ expected creat_vfs(dentry *base, const char *path, int mode) expected mknod_vfs(const char *path, mode_t mode, dev_t dev, struct dentry *dir) { - if (mode & S_IFBAD) + if (mode & S_IFMT & S_IFBAD) return unexpected{-EINVAL}; return namei_create_generic(dir, path, mode, 0); }