Skip to content

Commit

Permalink
Merge pull request #168 from carloslack/sys-statx-patch
Browse files Browse the repository at this point in the history
sys: Fix issue with /proc UI visibility
  • Loading branch information
carloslack authored Dec 21, 2024
2 parents e6763c8 + e2e4093 commit b5788a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,7 @@ 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)) {
if (name != NULL && !copy_from_user((void*)name, filename, PROCNAME_MAXLEN-1)) {
#endif
if (strlen(name) > 0 && S_ISDIR(stat->mode)) {
int count = fs_is_dir_inode_hidden((const char *)name, stat->ino);
Expand All @@ -1042,10 +1041,8 @@ static long m_vfs_statx(int dfd, struct filename *filename, int flags, struct ks
rv = -ENOENT;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
}
if (name)
kfree(name);
leave:
}
#endif
return rv;
}
Expand Down

0 comments on commit b5788a0

Please sign in to comment.