mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
security: lsm_audit: add ioctl specific auditing
Add information about ioctl calls to the LSM audit data. Log the file path and command number. Bug: 20350607 Bug: 18087110 Change-Id: Idbbd106db6226683cb30022d9e8f6f3b8fab7f84 Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
This commit is contained in:
parent
1efa4af958
commit
1cd4f9fa9a
2 changed files with 22 additions and 0 deletions
|
@ -40,6 +40,11 @@ struct lsm_network_audit {
|
||||||
} fam;
|
} fam;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct lsm_ioctlop_audit {
|
||||||
|
struct path path;
|
||||||
|
u16 cmd;
|
||||||
|
};
|
||||||
|
|
||||||
/* Auxiliary data to use in generating the audit record. */
|
/* Auxiliary data to use in generating the audit record. */
|
||||||
struct common_audit_data {
|
struct common_audit_data {
|
||||||
char type;
|
char type;
|
||||||
|
@ -53,6 +58,7 @@ struct common_audit_data {
|
||||||
#define LSM_AUDIT_DATA_KMOD 8
|
#define LSM_AUDIT_DATA_KMOD 8
|
||||||
#define LSM_AUDIT_DATA_INODE 9
|
#define LSM_AUDIT_DATA_INODE 9
|
||||||
#define LSM_AUDIT_DATA_DENTRY 10
|
#define LSM_AUDIT_DATA_DENTRY 10
|
||||||
|
#define LSM_AUDIT_DATA_IOCTL_OP 11
|
||||||
struct task_struct *tsk;
|
struct task_struct *tsk;
|
||||||
union {
|
union {
|
||||||
struct path path;
|
struct path path;
|
||||||
|
@ -69,6 +75,7 @@ struct common_audit_data {
|
||||||
} key_struct;
|
} key_struct;
|
||||||
#endif
|
#endif
|
||||||
char *kmod_name;
|
char *kmod_name;
|
||||||
|
struct lsm_ioctlop_audit *op;
|
||||||
} u;
|
} u;
|
||||||
/* this union contains LSM specific data */
|
/* this union contains LSM specific data */
|
||||||
union {
|
union {
|
||||||
|
|
|
@ -242,6 +242,21 @@ static void dump_common_audit_data(struct audit_buffer *ab,
|
||||||
}
|
}
|
||||||
break;
|
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: {
|
case LSM_AUDIT_DATA_DENTRY: {
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue