Skip to contentSkip to conversation

sysctl: Allow non-root to read mmap_min_addr value

PATCH New Adam Lackorzynski 1 participant 1 message May 12, 2010 Security (LSM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysctl: Allow non-root to read mmap_min_addr value

Although /proc/sys/vm/mmap_min_addr has 644 permissions a read call returns -EPERM. Allow any user to read the mmap_min_addr value.

---
 security/min_addr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/min_addr.c +1 -1
index e86f297..f728728 100644
@@ -33,7 +33,7 @@ int mmap_min_addr_handler(struct ctl_table *table, int write,
 {
 	int ret;
 
-	if (!capable(CAP_SYS_RAWIO))
+	if (write && !capable(CAP_SYS_RAWIO))
 		return -EPERM;
 
 	ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
Signature · 1 line
1.7.1