mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
notify_change(): check that i_mutex is held
Cc: Djalal Harouni <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
b5fb63c183
commit
c4107b3097
1 changed files with 2 additions and 1 deletions
|
|
@ -171,6 +171,8 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
|
|||
struct timespec now;
|
||||
unsigned int ia_valid = attr->ia_valid;
|
||||
|
||||
WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
|
||||
|
||||
if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_TIMES_SET)) {
|
||||
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
||||
return -EPERM;
|
||||
|
|
@ -250,5 +252,4 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
|
|||
|
||||
return error;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(notify_change);
|
||||
|
|
|
|||
Loading…
Reference in a new issue