What is the meaning of argument type: "const char __user *const __user *argv"

Viewed 1927

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 *

?

1 Answers

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.

Related