mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
introduce new LSM hooks where vfsmount is available.
Add new LSM hooks for path-based checks. Call them on directory-modifying operations at the points where we still know the vfsmount involved. Signed-off-by: Kentaro Takeda <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Toshiharu Harada <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
6a94cb7306
commit
be6d3e56a6
7 changed files with 314 additions and 0 deletions
|
|
@ -272,6 +272,8 @@ static long do_sys_truncate(const char __user *pathname, loff_t length)
|
|||
goto put_write_and_out;
|
||||
|
||||
error = locks_verify_truncate(inode, NULL, length);
|
||||
if (!error)
|
||||
error = security_path_truncate(&path, length, 0);
|
||||
if (!error) {
|
||||
DQUOT_INIT(inode);
|
||||
error = do_truncate(path.dentry, length, 0, NULL);
|
||||
|
|
@ -328,6 +330,9 @@ static long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
|
|||
goto out_putf;
|
||||
|
||||
error = locks_verify_truncate(inode, file, length);
|
||||
if (!error)
|
||||
error = security_path_truncate(&file->f_path, length,
|
||||
ATTR_MTIME|ATTR_CTIME);
|
||||
if (!error)
|
||||
error = do_truncate(dentry, length, ATTR_MTIME|ATTR_CTIME, file);
|
||||
out_putf:
|
||||
|
|
|
|||
Loading…
Reference in a new issue