Skip to content

Commit

Permalink
Merge branch 'next' of git://git.infradead.org/users/pcmoore/selinux …
Browse files Browse the repository at this point in the history
…into next
  • Loading branch information
James Morris committed Aug 15, 2015
2 parents 0e38c35 + fda4d57 commit 3e5f206
Show file tree
Hide file tree
Showing 14 changed files with 915 additions and 110 deletions.
7 changes: 7 additions & 0 deletions include/linux/lsm_audit.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ struct lsm_network_audit {
} fam;
};

struct lsm_ioctlop_audit {
struct path path;
u16 cmd;
};

/* Auxiliary data to use in generating the audit record. */
struct common_audit_data {
char type;
Expand All @@ -53,6 +58,7 @@ struct common_audit_data {
#define LSM_AUDIT_DATA_KMOD 8
#define LSM_AUDIT_DATA_INODE 9
#define LSM_AUDIT_DATA_DENTRY 10
#define LSM_AUDIT_DATA_IOCTL_OP 11
union {
struct path path;
struct dentry *dentry;
Expand All @@ -68,6 +74,7 @@ struct common_audit_data {
} key_struct;
#endif
char *kmod_name;
struct lsm_ioctlop_audit *op;
} u;
/* this union contains LSM specific data */
union {
Expand Down
1 change: 1 addition & 0 deletions scripts/selinux/mdp/mdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ int main(int argc, char *argv[])

/* types, roles, and allows */
fprintf(fout, "type base_t;\n");
fprintf(fout, "role base_r;\n");
fprintf(fout, "role base_r types { base_t };\n");
for (i = 0; secclass_map[i].name; i++)
fprintf(fout, "allow base_t base_t:%s *;\n",
Expand Down
15 changes: 15 additions & 0 deletions security/lsm_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ static void dump_common_audit_data(struct audit_buffer *ab,
}
break;
}
case LSM_AUDIT_DATA_IOCTL_OP: {
struct inode *inode;

audit_log_d_path(ab, " path=", &a->u.op->path);

inode = a->u.op->path.dentry->d_inode;
if (inode) {
audit_log_format(ab, " dev=");
audit_log_untrustedstring(ab, inode->i_sb->s_id);
audit_log_format(ab, " ino=%lu", inode->i_ino);
}

audit_log_format(ab, " ioctlcmd=%hx", a->u.op->cmd);
break;
}
case LSM_AUDIT_DATA_DENTRY: {
struct inode *inode;

Expand Down
Loading

0 comments on commit 3e5f206

Please sign in to comment.