One thing to note here is that the order in which files are checked for executable permissions is:
- View file permissions;
- See if the corresponding shell command has permission to execute;
- Look at the permissions of the directory to which the file belongs; this is also an item to check;
static struct file *do_open_execat(int fd, struct filename *name, int flags)
{
struct file *file;
int err;