vfs_stat()
is defined as:
int vfs_stat(const char __user *name, struct kstat *stat);
and __user
is defined as:
# define __user __attribute__((noderef, address_space(1)))
In other words, vfs_stat()
only supports using filename that is pointer into user space, and should not be dereferenced inside kernel space. Note that "/bin/ls"
does NOT point into user space, but into kernel space, and thus cannot be used here.
Actually, error message 14 (bad address) tells this issue right into your face :)