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>] [day] [month] [year] [list]
Message-Id: <1568704836-14357-1-git-send-email-zhang.lin16@zte.com.cn>
Date:   Tue, 17 Sep 2019 15:20:36 +0800
From:   zhanglin <zhang.lin16@....com.cn>
To:     paul@...l-moore.com
Cc:     sds@...ho.nsa.gov, eparis@...isplace.org, selinux@...r.kernel.org,
        linux-kernel@...r.kernel.org, xue.zhihong@....com.cn,
        wang.yi59@....com.cn, jiang.xuexin@....com.cn,
        zhanglin <zhang.lin16@....com.cn>
Subject: [PATCH] selinux: improve performance of sel_write_load()

remove unecessary multiplications of sel_write_load().

Signed-off-by: zhanglin <zhang.lin16@....com.cn>
---
 security/selinux/selinuxfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index f3a5a138a096..4b2d87b6fcf9 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -117,6 +117,7 @@ static void selinux_fs_info_free(struct super_block *sb)
 #define SEL_CLASS_INO_OFFSET		0x04000000
 #define SEL_POLICYCAP_INO_OFFSET	0x08000000
 #define SEL_INO_MASK			0x00ffffff
+#define SEL_LOAD_MAX			0x04000000
 
 #define TMPBUFLEN	12
 static ssize_t sel_read_enforce(struct file *filp, char __user *buf,
@@ -550,7 +551,7 @@ static ssize_t sel_write_load(struct file *file, const char __user *buf,
 		goto out;
 
 	length = -EFBIG;
-	if (count > 64 * 1024 * 1024)
+	if (count > SEL_LOAD_MAX)
 		goto out;
 
 	length = -ENOMEM;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ