selinux: Remove load size limit
diff mbox series

Message ID 1569031035-12354-1-git-send-email-zhang.lin16@zte.com.cn
State Accepted
Headers show
Series
  • selinux: Remove load size limit
Related show

Commit Message

zhanglin Sept. 21, 2019, 1:57 a.m. UTC
Load size was limited to 64MB, this was legacy limitation due to vmalloc()
which was removed a while ago.

Limiting load size to 64MB is both pointless and affects real world use
cases.

Signed-off-by: zhanglin <zhang.lin16@zte.com.cn>
---
 security/selinux/selinuxfs.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Paul Moore Oct. 1, 2019, 1:36 p.m. UTC | #1
On Fri, Sep 20, 2019 at 9:55 PM zhanglin <zhang.lin16@zte.com.cn> wrote:
> Load size was limited to 64MB, this was legacy limitation due to vmalloc()
> which was removed a while ago.
>
> Limiting load size to 64MB is both pointless and affects real world use
> cases.
>
> Signed-off-by: zhanglin <zhang.lin16@zte.com.cn>
> ---
>  security/selinux/selinuxfs.c | 4 ----
>  1 file changed, 4 deletions(-)

I just merged this into selinux/next (thank you!), but I removed the
last sentence in the description that mentioned "real world use cases"
since that appears to be a cut-n-paste artifact and not a reflection
of what we are currently seeing from users.

Patch
diff mbox series

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index f3a5a138a096..4249400e9712 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -549,10 +549,6 @@  static ssize_t sel_write_load(struct file *file, const char __user *buf,
 	if (*ppos != 0)
 		goto out;
 
-	length = -EFBIG;
-	if (count > 64 * 1024 * 1024)
-		goto out;
-
 	length = -ENOMEM;
 	data = vmalloc(count);
 	if (!data)