s/allocator/allocation/ in the subject. > - rse = kzalloc(rse_len, GFP_KERNEL); > + rse = kvzalloc(rse_len, GFP_KERNEL); You'll also need it to free it using kvfree if you you use kvzalloc. We might also want to add some upper bound to the number of keys to not allow the user to allocate 4GB of pinned kernel memory.