diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2019-01-23 13:35:00 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2019-01-30 20:51:47 -0500 |
commit | 57d4657716aca81ef4d7ec23e8123d26e3d28954 (patch) | |
tree | 61af3d955d7a01767f7d1e6ede67ca6096cc8a07 /kernel/audit.c | |
parent | 05c7a9cb2727cd3c3d8e767f48e5cd18486a8d16 (diff) |
audit: ignore fcaps on umount
Don't fetch fcaps when umount2 is called to avoid a process hang while
it waits for the missing resource to (possibly never) re-appear.
Note the comment above user_path_mountpoint_at():
* A umount is a special case for path walking. We're not actually interested
* in the inode in this situation, and ESTALE errors can be a problem. We
* simply want track down the dentry and vfsmount attached at the mountpoint
* and avoid revalidating the last component.
This can happen on ceph, cifs, 9p, lustre, fuse (gluster) or NFS.
Please see the github issue tracker
https://github.com/linux-audit/audit-kernel/issues/100
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
[PM: merge fuzz in audit_log_fcaps()]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 3f3f1888cac7..b7177a8def2e 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -2082,6 +2082,10 @@ void audit_log_cap(struct audit_buffer *ab, char *prefix, kernel_cap_t *cap) | |||
2082 | 2082 | ||
2083 | static void audit_log_fcaps(struct audit_buffer *ab, struct audit_names *name) | 2083 | static void audit_log_fcaps(struct audit_buffer *ab, struct audit_names *name) |
2084 | { | 2084 | { |
2085 | if (name->fcap_ver == -1) { | ||
2086 | audit_log_format(ab, " cap_fe=? cap_fver=? cap_fp=? cap_fi=?"); | ||
2087 | return; | ||
2088 | } | ||
2085 | audit_log_cap(ab, "cap_fp", &name->fcap.permitted); | 2089 | audit_log_cap(ab, "cap_fp", &name->fcap.permitted); |
2086 | audit_log_cap(ab, "cap_fi", &name->fcap.inheritable); | 2090 | audit_log_cap(ab, "cap_fi", &name->fcap.inheritable); |
2087 | audit_log_format(ab, " cap_fe=%d cap_fver=%x cap_frootid=%d", | 2091 | audit_log_format(ab, " cap_fe=%d cap_fver=%x cap_frootid=%d", |
@@ -2114,7 +2118,7 @@ static inline int audit_copy_fcaps(struct audit_names *name, | |||
2114 | 2118 | ||
2115 | /* Copy inode data into an audit_names. */ | 2119 | /* Copy inode data into an audit_names. */ |
2116 | void audit_copy_inode(struct audit_names *name, const struct dentry *dentry, | 2120 | void audit_copy_inode(struct audit_names *name, const struct dentry *dentry, |
2117 | struct inode *inode) | 2121 | struct inode *inode, unsigned int flags) |
2118 | { | 2122 | { |
2119 | name->ino = inode->i_ino; | 2123 | name->ino = inode->i_ino; |
2120 | name->dev = inode->i_sb->s_dev; | 2124 | name->dev = inode->i_sb->s_dev; |
@@ -2123,6 +2127,10 @@ void audit_copy_inode(struct audit_names *name, const struct dentry *dentry, | |||
2123 | name->gid = inode->i_gid; | 2127 | name->gid = inode->i_gid; |
2124 | name->rdev = inode->i_rdev; | 2128 | name->rdev = inode->i_rdev; |
2125 | security_inode_getsecid(inode, &name->osid); | 2129 | security_inode_getsecid(inode, &name->osid); |
2130 | if (flags & AUDIT_INODE_NOEVAL) { | ||
2131 | name->fcap_ver = -1; | ||
2132 | return; | ||
2133 | } | ||
2126 | audit_copy_fcaps(name, dentry); | 2134 | audit_copy_fcaps(name, dentry); |
2127 | } | 2135 | } |
2128 | 2136 | ||