3

I see this kind of type in the execve syscall:

asmlinkage long sys_execve(const char __user *filename,
const char __user *const __user *argv,
const char __user *const __user *envp);


do_execve(struct filename *filename,
const char __user *const __user *__argv,
const char __user *const __user *__envp)

What is the meaning of

const char __user *const __user *

?

WindChaser
  • 960
  • 1
  • 10
  • 30

1 Answers1

3

As you read through the list of file_operations methods, you will note that a number of parameters include the string __user. This annotation is a form of documentation, noting that a pointer is a user-space address that cannot be directly dereferenced. For normal compilation, __user has no effect, but it can be used by external checking software to find misuse of user-space addresses.

Alien
  • 15,141
  • 6
  • 37
  • 57
manish
  • 31
  • 3