lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100414024842.GB3718@localhost.localdomain>
Date:	Wed, 14 Apr 2010 10:48:42 +0800
From:	wzt.wzt@...il.com
To:	linux-kernel@...r.kernel.org
Cc:	linux-security-module@...r.kernel.org, jmorris@...ei.org
Subject: Security: Replace dac_mmap_min_addr to mmap_min_addr in cap_file_mmap()

cap_file_mmap() comments said "If the process is attempting to map 
memory below mmap_min_addr", if CONFIG_LSM_MMAP_MIN_ADDR is set, 
dac_mmap_min_addr is not equal mmap_min_addr, so replace dac_mmap_min_addr
to mmap_min_addr seems to be better.

Signed-off-by: Zhitong Wang <zhitong.wangzt@...baba-inc.com>

---
 include/linux/security.h |    1 +
 security/commoncap.c     |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/security.h b/include/linux/security.h
index 233d20b..61fd9e7 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -101,6 +101,7 @@ void reset_security_ops(void);
 extern unsigned long mmap_min_addr;
 extern unsigned long dac_mmap_min_addr;
 #else
+#define mmap_min_addr		0UL
 #define dac_mmap_min_addr	0UL
 #endif
 
diff --git a/security/commoncap.c b/security/commoncap.c
index 6166973..878cf89 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -942,7 +942,7 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
 {
 	int ret = 0;
 
-	if (addr < dac_mmap_min_addr) {
+	if (addr < mmap_min_addr) {
 		ret = cap_capable(current, current_cred(), CAP_SYS_RAWIO,
 				  SECURITY_CAP_AUDIT);
 		/* set PF_SUPERPRIV if it turns out we allow the low mmap */
-- 
1.6.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ