Skip to content

Commit 3e5f206

Browse files
author
James Morris
committed
Merge branch 'next' of git://git.infradead.org/users/pcmoore/selinux into next
2 parents 0e38c35 + fda4d57 commit 3e5f206

14 files changed

Lines changed: 915 additions & 110 deletions

File tree

‎include/linux/lsm_audit.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ struct lsm_network_audit {
4040
} fam;
4141
};
4242

43+
struct lsm_ioctlop_audit {
44+
struct path path;
45+
u16 cmd;
46+
};
47+
4348
/* Auxiliary data to use in generating the audit record. */
4449
struct common_audit_data {
4550
char type;
@@ -53,6 +58,7 @@ struct common_audit_data {
5358
#define LSM_AUDIT_DATA_KMOD 8
5459
#define LSM_AUDIT_DATA_INODE 9
5560
#define LSM_AUDIT_DATA_DENTRY 10
61+
#define LSM_AUDIT_DATA_IOCTL_OP 11
5662
union {
5763
struct path path;
5864
struct dentry *dentry;
@@ -68,6 +74,7 @@ struct common_audit_data {
6874
} key_struct;
6975
#endif
7076
char *kmod_name;
77+
struct lsm_ioctlop_audit *op;
7178
} u;
7279
/* this union contains LSM specific data */
7380
union {

‎scripts/selinux/mdp/mdp.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
9898

9999
/* types, roles, and allows */
100100
fprintf(fout, "type base_t;\n");
101+
fprintf(fout, "role base_r;\n");
101102
fprintf(fout, "role base_r types { base_t };\n");
102103
for (i = 0; secclass_map[i].name; i++)
103104
fprintf(fout, "allow base_t base_t:%s *;\n",

‎security/lsm_audit.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ static void dump_common_audit_data(struct audit_buffer *ab,
245245
}
246246
break;
247247
}
248+
case LSM_AUDIT_DATA_IOCTL_OP: {
249+
struct inode *inode;
250+
251+
audit_log_d_path(ab, " path=", &a->u.op->path);
252+
253+
inode = a->u.op->path.dentry->d_inode;
254+
if (inode) {
255+
audit_log_format(ab, " dev=");
256+
audit_log_untrustedstring(ab, inode->i_sb->s_id);
257+
audit_log_format(ab, " ino=%lu", inode->i_ino);
258+
}
259+
260+
audit_log_format(ab, " ioctlcmd=%hx", a->u.op->cmd);
261+
break;
262+
}
248263
case LSM_AUDIT_DATA_DENTRY: {
249264
struct inode *inode;
250265

0 commit comments

Comments
 (0)