|
@@ -1146,7 +1146,7 @@ static int smack_file_ioctl(struct file *file, unsigned int cmd,
|
|
|
* @file: the object
|
|
|
* @cmd: unused
|
|
|
*
|
|
|
- * Returns 0 if current has write access, error code otherwise
|
|
|
+ * Returns 0 if current has lock access, error code otherwise
|
|
|
*/
|
|
|
static int smack_file_lock(struct file *file, unsigned int cmd)
|
|
|
{
|
|
@@ -1154,7 +1154,7 @@ static int smack_file_lock(struct file *file, unsigned int cmd)
|
|
|
|
|
|
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
|
|
|
smk_ad_setfield_u_fs_path(&ad, file->f_path);
|
|
|
- return smk_curacc(file->f_security, MAY_WRITE, &ad);
|
|
|
+ return smk_curacc(file->f_security, MAY_LOCK, &ad);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1178,8 +1178,13 @@ static int smack_file_fcntl(struct file *file, unsigned int cmd,
|
|
|
|
|
|
switch (cmd) {
|
|
|
case F_GETLK:
|
|
|
+ break;
|
|
|
case F_SETLK:
|
|
|
case F_SETLKW:
|
|
|
+ smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
|
|
|
+ smk_ad_setfield_u_fs_path(&ad, file->f_path);
|
|
|
+ rc = smk_curacc(file->f_security, MAY_LOCK, &ad);
|
|
|
+ break;
|
|
|
case F_SETOWN:
|
|
|
case F_SETSIG:
|
|
|
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
|