Commit aa0c0227 authored by Tyler Hicks's avatar Tyler Hicks Committed by Mimi Zohar

ima: Use correct type for the args_p member of ima_rule_entry.lsm elements

Make args_p be of the char pointer type rather than have it be a void
pointer that gets casted to char pointer when it is used. It is a simple
NUL-terminated string as returned by match_strdup().
Signed-off-by: default avatarTyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 39e5993d
...@@ -74,7 +74,7 @@ struct ima_rule_entry { ...@@ -74,7 +74,7 @@ struct ima_rule_entry {
int pcr; int pcr;
struct { struct {
void *rule; /* LSM file metadata specific */ void *rule; /* LSM file metadata specific */
void *args_p; /* audit value */ char *args_p; /* audit value */
int type; /* audit type */ int type; /* audit type */
} lsm[MAX_LSM_RULES]; } lsm[MAX_LSM_RULES];
char *fsname; char *fsname;
...@@ -314,7 +314,7 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) ...@@ -314,7 +314,7 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry)
&nentry->lsm[i].rule); &nentry->lsm[i].rule);
if (!nentry->lsm[i].rule) if (!nentry->lsm[i].rule)
pr_warn("rule for LSM \'%s\' is undefined\n", pr_warn("rule for LSM \'%s\' is undefined\n",
(char *)nentry->lsm[i].args_p); nentry->lsm[i].args_p);
} }
return nentry; return nentry;
} }
...@@ -918,7 +918,7 @@ static int ima_lsm_rule_init(struct ima_rule_entry *entry, ...@@ -918,7 +918,7 @@ static int ima_lsm_rule_init(struct ima_rule_entry *entry,
&entry->lsm[lsm_rule].rule); &entry->lsm[lsm_rule].rule);
if (!entry->lsm[lsm_rule].rule) { if (!entry->lsm[lsm_rule].rule) {
pr_warn("rule for LSM \'%s\' is undefined\n", pr_warn("rule for LSM \'%s\' is undefined\n",
(char *)entry->lsm[lsm_rule].args_p); entry->lsm[lsm_rule].args_p);
if (ima_rules == &ima_default_rules) { if (ima_rules == &ima_default_rules) {
kfree(entry->lsm[lsm_rule].args_p); kfree(entry->lsm[lsm_rule].args_p);
...@@ -1684,27 +1684,27 @@ int ima_policy_show(struct seq_file *m, void *v) ...@@ -1684,27 +1684,27 @@ int ima_policy_show(struct seq_file *m, void *v)
switch (i) { switch (i) {
case LSM_OBJ_USER: case LSM_OBJ_USER:
seq_printf(m, pt(Opt_obj_user), seq_printf(m, pt(Opt_obj_user),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
case LSM_OBJ_ROLE: case LSM_OBJ_ROLE:
seq_printf(m, pt(Opt_obj_role), seq_printf(m, pt(Opt_obj_role),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
case LSM_OBJ_TYPE: case LSM_OBJ_TYPE:
seq_printf(m, pt(Opt_obj_type), seq_printf(m, pt(Opt_obj_type),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
case LSM_SUBJ_USER: case LSM_SUBJ_USER:
seq_printf(m, pt(Opt_subj_user), seq_printf(m, pt(Opt_subj_user),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
case LSM_SUBJ_ROLE: case LSM_SUBJ_ROLE:
seq_printf(m, pt(Opt_subj_role), seq_printf(m, pt(Opt_subj_role),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
case LSM_SUBJ_TYPE: case LSM_SUBJ_TYPE:
seq_printf(m, pt(Opt_subj_type), seq_printf(m, pt(Opt_subj_type),
(char *)entry->lsm[i].args_p); entry->lsm[i].args_p);
break; break;
} }
seq_puts(m, " "); seq_puts(m, " ");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment