From 9f0604c36b2d73c046e9ace875ba7484098e5c54 Mon Sep 17 00:00:00 2001 From: JNE Date: Fri, 20 Dec 2024 23:44:38 +0000 Subject: [PATCH] sys: Fix issue with /proc UI visibility Switch back to stack allocation Remove useless check --- src/sys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/sys.c b/src/sys.c index 4bf805c..27f5eeb 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1012,7 +1012,7 @@ static long (*real_vfs_statx)(int, struct filename *, int, struct kstat *, u32) static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct kstat *stat, u32 request_mask) { #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - char *name = kzalloc(PROCNAME_MAXLEN, GFP_KERNEL); + char name[PROCNAME_MAXLEN] = {0}; #else char *name = filename ? filename->name : ""; #endif @@ -1027,7 +1027,6 @@ static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct ks * */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - if (!name) goto leave; if (!copy_from_user((void*)name, filename, sizeof(name)-1)) { #endif if (strlen(name) > 0 && S_ISDIR(stat->mode)) { @@ -1043,8 +1042,6 @@ static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct ks } #if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) } - if (name) - kfree(name); leave: #endif return rv;