Identified Redundant Capability Check in File Access under /proc/sys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello developers,

I hope this message finds you well. I wanted to bring to your attention an observation regarding file access under /proc/sys in the kernel source code.

Upon review, it appears that certain files are protected by capabilities in the kernel source code; however, the capability check does not seem to be effectively enforced during file access.

For example, I noticed this inconsistency in the access functions of some special files:
1. The access function mmap_min_addr_handler() in /proc/sys/vm/mmap_min_addr utilizes the CAP_SYS_RAWIO check.
2. The access function proc_dointvec_minmax_sysadmin() in /proc/sys/kernel/kptr_restrict requires the CAP_SYS_ADMIN check.

Despite these capability checks in the source code, when accessing a file, it undergoes a UGO permission check before triggering these specialized file access functions. The UGO permissions for these files are configured as root:root rw- r-- r--, meaning only the root user can pass the UGO check.

As a result, to access these files, one must be the root user, who inherently possesses all capabilities. Consequently, the capabilities check in the file access function seems redundant.

Please consider reviewing and adjusting the capability checks in the mentioned access functions for better alignment with the UGO permissions.

Thank you for your attention to this matter.

Best regards,
Jingzi Meng




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux