-1

Can you explain me this piece of code ? what does __user here mean ?

int create(struct mystruct __user *arg) {
  void __user *user_config;
}

(I only post part of the function) Any reply is much appreciated. Thank you.

Tran Ngu Dang
  • 2,540
  • 6
  • 29
  • 38

1 Answers1

2

It tells the kernel developers that the pointer is user supplied, so it shouldn't be trusted and needs to be validated before operating on.

There are many such definitions in Linux kernel.

https://en.wikipedia.org/wiki/Sparse#Linux_kernel_definitions

ronakg
  • 4,038
  • 21
  • 46