0

I'm uncertain if I'm understanding this correctly. In Linux we have user space and kernel space. Each with their own region. Processes running in user space should not be able to access the kernel's memory regions.

This is where I'm a bit confused. I'm using kmalloc with the GFP_USER flag to allocate memory for a struct, but since I'm given it the GFP_USER flag, is kmalloc allocating space within the user space region?

I'm later on using copy_to_user, which to my understanding, copies an entry from the kernel's memory into the user space's memory region, but is that even needed if kmalloc is already allocating the memory within the user space?

Jazerix
  • 4,729
  • 10
  • 39
  • 71

0 Answers0