ima: rename FILE_MMAP to MMAP_CHECK
Rename FILE_MMAP hook to MMAP_CHECK to be consistent with the other hook names. Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
This commit is contained in:
Родитель
b51524635b
Коммит
16cac49f72
|
@ -23,7 +23,7 @@ Description:
|
||||||
lsm: [[subj_user=] [subj_role=] [subj_type=]
|
lsm: [[subj_user=] [subj_role=] [subj_type=]
|
||||||
[obj_user=] [obj_role=] [obj_type=]]
|
[obj_user=] [obj_role=] [obj_type=]]
|
||||||
|
|
||||||
base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK][MODULE_CHECK]
|
base: func:= [BPRM_CHECK][MMAP_CHECK][FILE_CHECK][MODULE_CHECK]
|
||||||
mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
|
mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
|
||||||
fsmagic:= hex value
|
fsmagic:= hex value
|
||||||
uid:= decimal value
|
uid:= decimal value
|
||||||
|
|
|
@ -127,7 +127,7 @@ struct integrity_iint_cache *integrity_iint_insert(struct inode *inode);
|
||||||
struct integrity_iint_cache *integrity_iint_find(struct inode *inode);
|
struct integrity_iint_cache *integrity_iint_find(struct inode *inode);
|
||||||
|
|
||||||
/* IMA policy related functions */
|
/* IMA policy related functions */
|
||||||
enum ima_hooks { FILE_CHECK = 1, FILE_MMAP, BPRM_CHECK, MODULE_CHECK, POST_SETATTR };
|
enum ima_hooks { FILE_CHECK = 1, MMAP_CHECK, BPRM_CHECK, MODULE_CHECK, POST_SETATTR };
|
||||||
|
|
||||||
int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask,
|
int ima_match_policy(struct inode *inode, enum ima_hooks func, int mask,
|
||||||
int flags);
|
int flags);
|
||||||
|
|
|
@ -100,12 +100,12 @@ err_out:
|
||||||
* ima_get_action - appraise & measure decision based on policy.
|
* ima_get_action - appraise & measure decision based on policy.
|
||||||
* @inode: pointer to inode to measure
|
* @inode: pointer to inode to measure
|
||||||
* @mask: contains the permission mask (MAY_READ, MAY_WRITE, MAY_EXECUTE)
|
* @mask: contains the permission mask (MAY_READ, MAY_WRITE, MAY_EXECUTE)
|
||||||
* @function: calling function (FILE_CHECK, BPRM_CHECK, FILE_MMAP, MODULE_CHECK)
|
* @function: calling function (FILE_CHECK, BPRM_CHECK, MMAP_CHECK, MODULE_CHECK)
|
||||||
*
|
*
|
||||||
* The policy is defined in terms of keypairs:
|
* The policy is defined in terms of keypairs:
|
||||||
* subj=, obj=, type=, func=, mask=, fsmagic=
|
* subj=, obj=, type=, func=, mask=, fsmagic=
|
||||||
* subj,obj, and type: are LSM specific.
|
* subj,obj, and type: are LSM specific.
|
||||||
* func: FILE_CHECK | BPRM_CHECK | FILE_MMAP | MODULE_CHECK
|
* func: FILE_CHECK | BPRM_CHECK | MMAP_CHECK | MODULE_CHECK
|
||||||
* mask: contains the permission mask
|
* mask: contains the permission mask
|
||||||
* fsmagic: hex value
|
* fsmagic: hex value
|
||||||
*
|
*
|
||||||
|
|
|
@ -228,7 +228,7 @@ int ima_file_mmap(struct file *file, unsigned long prot)
|
||||||
{
|
{
|
||||||
if (file && (prot & PROT_EXEC))
|
if (file && (prot & PROT_EXEC))
|
||||||
return process_measurement(file, file->f_dentry->d_name.name,
|
return process_measurement(file, file->f_dentry->d_name.name,
|
||||||
MAY_EXEC, FILE_MMAP);
|
MAY_EXEC, MMAP_CHECK);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ static struct ima_rule_entry default_rules[] = {
|
||||||
{.action = DONT_MEASURE,.fsmagic = BINFMTFS_MAGIC,.flags = IMA_FSMAGIC},
|
{.action = DONT_MEASURE,.fsmagic = BINFMTFS_MAGIC,.flags = IMA_FSMAGIC},
|
||||||
{.action = DONT_MEASURE,.fsmagic = SECURITYFS_MAGIC,.flags = IMA_FSMAGIC},
|
{.action = DONT_MEASURE,.fsmagic = SECURITYFS_MAGIC,.flags = IMA_FSMAGIC},
|
||||||
{.action = DONT_MEASURE,.fsmagic = SELINUX_MAGIC,.flags = IMA_FSMAGIC},
|
{.action = DONT_MEASURE,.fsmagic = SELINUX_MAGIC,.flags = IMA_FSMAGIC},
|
||||||
{.action = MEASURE,.func = FILE_MMAP,.mask = MAY_EXEC,
|
{.action = MEASURE,.func = MMAP_CHECK,.mask = MAY_EXEC,
|
||||||
.flags = IMA_FUNC | IMA_MASK},
|
.flags = IMA_FUNC | IMA_MASK},
|
||||||
{.action = MEASURE,.func = BPRM_CHECK,.mask = MAY_EXEC,
|
{.action = MEASURE,.func = BPRM_CHECK,.mask = MAY_EXEC,
|
||||||
.flags = IMA_FUNC | IMA_MASK},
|
.flags = IMA_FUNC | IMA_MASK},
|
||||||
|
@ -448,8 +448,9 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
|
||||||
entry->func = FILE_CHECK;
|
entry->func = FILE_CHECK;
|
||||||
else if (strcmp(args[0].from, "MODULE_CHECK") == 0)
|
else if (strcmp(args[0].from, "MODULE_CHECK") == 0)
|
||||||
entry->func = MODULE_CHECK;
|
entry->func = MODULE_CHECK;
|
||||||
else if (strcmp(args[0].from, "FILE_MMAP") == 0)
|
else if ((strcmp(args[0].from, "FILE_MMAP") == 0)
|
||||||
entry->func = FILE_MMAP;
|
|| (strcmp(args[0].from, "MMAP_CHECK") == 0))
|
||||||
|
entry->func = MMAP_CHECK;
|
||||||
else if (strcmp(args[0].from, "BPRM_CHECK") == 0)
|
else if (strcmp(args[0].from, "BPRM_CHECK") == 0)
|
||||||
entry->func = BPRM_CHECK;
|
entry->func = BPRM_CHECK;
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче