Skip to content

Commit 7d1e042

Browse files
committed
Merge tag 'usercopy-v4.8-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull usercopy hardening fix from Kees Cook: "Expand the arm64 vmalloc check to include skipping the module space too" * tag 'usercopy-v4.8-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: mm: usercopy: Check for module addresses
2 parents e23d415 + aa4f060 commit 7d1e042

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mm/usercopy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n,
207207
* Some architectures (arm64) return true for virt_addr_valid() on
208208
* vmalloced addresses. Work around this by checking for vmalloc
209209
* first.
210+
*
211+
* We also need to check for module addresses explicitly since we
212+
* may copy static data from modules to userspace
210213
*/
211-
if (is_vmalloc_addr(ptr))
214+
if (is_vmalloc_or_module_addr(ptr))
212215
return NULL;
213216

214217
if (!virt_addr_valid(ptr))

0 commit comments

Comments
 (0)