diff options
-rw-r--r-- | fs/namei.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index 5ba42c453e31..7c8a93042e63 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -584,19 +584,19 @@ static inline int exec_permission(struct inode *inode, unsigned int flags) | |||
584 | 584 | ||
585 | if (inode->i_op->permission) { | 585 | if (inode->i_op->permission) { |
586 | ret = inode->i_op->permission(inode, MAY_EXEC, flags); | 586 | ret = inode->i_op->permission(inode, MAY_EXEC, flags); |
587 | if (likely(!ret)) | ||
588 | goto ok; | ||
587 | } else { | 589 | } else { |
588 | ret = acl_permission_check(inode, MAY_EXEC, flags, | 590 | ret = acl_permission_check(inode, MAY_EXEC, flags, |
589 | inode->i_op->check_acl); | 591 | inode->i_op->check_acl); |
592 | if (likely(!ret)) | ||
593 | goto ok; | ||
594 | if (ret != -EACCES) | ||
595 | return ret; | ||
596 | if (ns_capable(ns, CAP_DAC_OVERRIDE) || | ||
597 | ns_capable(ns, CAP_DAC_READ_SEARCH)) | ||
598 | goto ok; | ||
590 | } | 599 | } |
591 | if (likely(!ret)) | ||
592 | goto ok; | ||
593 | if (ret == -ECHILD) | ||
594 | return ret; | ||
595 | |||
596 | if (ns_capable(ns, CAP_DAC_OVERRIDE) || | ||
597 | ns_capable(ns, CAP_DAC_READ_SEARCH)) | ||
598 | goto ok; | ||
599 | |||
600 | return ret; | 600 | return ret; |
601 | ok: | 601 | ok: |
602 | return security_inode_exec_permission(inode, flags); | 602 | return security_inode_exec_permission(inode, flags); |