[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181011233117.7883-5-rick.p.edgecombe@intel.com>
Date: Thu, 11 Oct 2018 16:31:14 -0700
From: Rick Edgecombe <rick.p.edgecombe@...el.com>
To: kernel-hardening@...ts.openwall.com, daniel@...earbox.net,
keescook@...omium.org, catalin.marinas@....com,
will.deacon@....com, davem@...emloft.net, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, arnd@...db.de,
jeyu@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-arch@...r.kernel.org
Cc: kristen@...ux.intel.com, dave.hansen@...el.com,
arjan@...ux.intel.com, deneen.t.dock@...el.com,
Rick Edgecombe <rick.p.edgecombe@...el.com>
Subject: [PATCH v2 4/7] arm64/modules: Add rlimit checking for arm64 modules
This adds in the rlimit checking for the arm64 module allocator.
This has not been tested.
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@...el.com>
---
arch/arm64/kernel/module.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
index f0f27aeefb73..ea9794f2f571 100644
--- a/arch/arm64/kernel/module.c
+++ b/arch/arm64/kernel/module.c
@@ -39,6 +39,9 @@ void *module_alloc(unsigned long size)
if (IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
gfp_mask |= __GFP_NOWARN;
+ if (check_inc_mod_rlimit(size))
+ return NULL;
+
p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
module_alloc_base + MODULES_VSIZE,
gfp_mask, PAGE_KERNEL_EXEC, 0,
@@ -65,6 +68,8 @@ void *module_alloc(unsigned long size)
return NULL;
}
+ update_mod_rlimit(p, size);
+
return p;
}
--
2.17.1
Powered by blists - more mailing lists