This is the patch from debian for this issue. The driver seems to compile fine with it.
** Patch added: "kmem_cache_create_usercopy.patch" https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1802622/+attachment/5264097/+files/kmem_cache_create_usercopy.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1802622 Title: Ubuntu Cosmic nvidia-340 needs patch for "Bad or missing usercopy whitelist? Kernel memory exposure attempt detected from SLUB object 'nvidia_stack_t' To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1802622/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs