if (rc)
goto out;
} else {
+ unsigned long slabflags = 0;
+
if (size > (SPL_MAX_KMEM_ORDER_NR_PAGES * PAGE_SIZE)) {
rc = EINVAL;
goto out;
}
+#if defined(SLAB_USERCOPY)
+ /*
+ * Required for PAX-enabled kernels if the slab is to be
+ * used for coping between user and kernel space.
+ */
+ slabflags |= SLAB_USERCOPY;
+#endif
+
skc->skc_linux_cache = kmem_cache_create(
- skc->skc_name, size, align, 0, NULL);
+ skc->skc_name, size, align, slabflags, NULL);
if (skc->skc_linux_cache == NULL) {
rc = ENOMEM;
goto out;