Skip to content

Commit

Permalink
sys: Fix issue with /proc UI visibility
Browse files Browse the repository at this point in the history
Switch back to stack allocation
Remove useless check
  • Loading branch information
JNE committed Dec 20, 2024
1 parent fcad9ef commit 9f0604c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand All @@ -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;
Expand Down

0 comments on commit 9f0604c

Please sign in to comment.