diff options
Diffstat (limited to 'kernel/auditsc.c')
| -rw-r--r-- | kernel/auditsc.c | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 145cbb79c4b9..bde1124d5908 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
| @@ -173,12 +173,6 @@ struct audit_aux_data_fd_pair { | |||
| 173 | int fd[2]; | 173 | int fd[2]; |
| 174 | }; | 174 | }; |
| 175 | 175 | ||
| 176 | struct audit_aux_data_path { | ||
| 177 | struct audit_aux_data d; | ||
| 178 | struct dentry *dentry; | ||
| 179 | struct vfsmount *mnt; | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct audit_aux_data_pids { | 176 | struct audit_aux_data_pids { |
| 183 | struct audit_aux_data d; | 177 | struct audit_aux_data d; |
| 184 | pid_t target_pid[AUDIT_AUX_PIDS]; | 178 | pid_t target_pid[AUDIT_AUX_PIDS]; |
| @@ -654,12 +648,6 @@ static inline void audit_free_aux(struct audit_context *context) | |||
| 654 | struct audit_aux_data *aux; | 648 | struct audit_aux_data *aux; |
| 655 | 649 | ||
| 656 | while ((aux = context->aux)) { | 650 | while ((aux = context->aux)) { |
| 657 | if (aux->type == AUDIT_AVC_PATH) { | ||
| 658 | struct audit_aux_data_path *axi = (void *)aux; | ||
| 659 | dput(axi->dentry); | ||
| 660 | mntput(axi->mnt); | ||
| 661 | } | ||
| 662 | |||
| 663 | context->aux = aux->next; | 651 | context->aux = aux->next; |
| 664 | kfree(aux); | 652 | kfree(aux); |
| 665 | } | 653 | } |
| @@ -995,7 +983,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
| 995 | case AUDIT_IPC: { | 983 | case AUDIT_IPC: { |
| 996 | struct audit_aux_data_ipcctl *axi = (void *)aux; | 984 | struct audit_aux_data_ipcctl *axi = (void *)aux; |
| 997 | audit_log_format(ab, | 985 | audit_log_format(ab, |
| 998 | "ouid=%u ogid=%u mode=%x", | 986 | "ouid=%u ogid=%u mode=%#o", |
| 999 | axi->uid, axi->gid, axi->mode); | 987 | axi->uid, axi->gid, axi->mode); |
| 1000 | if (axi->osid != 0) { | 988 | if (axi->osid != 0) { |
| 1001 | char *ctx = NULL; | 989 | char *ctx = NULL; |
| @@ -1014,7 +1002,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
| 1014 | case AUDIT_IPC_SET_PERM: { | 1002 | case AUDIT_IPC_SET_PERM: { |
| 1015 | struct audit_aux_data_ipcctl *axi = (void *)aux; | 1003 | struct audit_aux_data_ipcctl *axi = (void *)aux; |
| 1016 | audit_log_format(ab, | 1004 | audit_log_format(ab, |
| 1017 | "qbytes=%lx ouid=%u ogid=%u mode=%x", | 1005 | "qbytes=%lx ouid=%u ogid=%u mode=%#o", |
| 1018 | axi->qbytes, axi->uid, axi->gid, axi->mode); | 1006 | axi->qbytes, axi->uid, axi->gid, axi->mode); |
| 1019 | break; } | 1007 | break; } |
| 1020 | 1008 | ||
| @@ -1038,11 +1026,6 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
| 1038 | audit_log_hex(ab, axs->a, axs->len); | 1026 | audit_log_hex(ab, axs->a, axs->len); |
| 1039 | break; } | 1027 | break; } |
| 1040 | 1028 | ||
| 1041 | case AUDIT_AVC_PATH: { | ||
| 1042 | struct audit_aux_data_path *axi = (void *)aux; | ||
| 1043 | audit_log_d_path(ab, "path=", axi->dentry, axi->mnt); | ||
| 1044 | break; } | ||
| 1045 | |||
| 1046 | case AUDIT_FD_PAIR: { | 1029 | case AUDIT_FD_PAIR: { |
| 1047 | struct audit_aux_data_fd_pair *axs = (void *)aux; | 1030 | struct audit_aux_data_fd_pair *axs = (void *)aux; |
| 1048 | audit_log_format(ab, "fd0=%d fd1=%d", axs->fd[0], axs->fd[1]); | 1031 | audit_log_format(ab, "fd0=%d fd1=%d", axs->fd[0], axs->fd[1]); |
| @@ -1991,36 +1974,6 @@ void __audit_ptrace(struct task_struct *t) | |||
| 1991 | } | 1974 | } |
| 1992 | 1975 | ||
| 1993 | /** | 1976 | /** |
| 1994 | * audit_avc_path - record the granting or denial of permissions | ||
| 1995 | * @dentry: dentry to record | ||
| 1996 | * @mnt: mnt to record | ||
| 1997 | * | ||
| 1998 | * Returns 0 for success or NULL context or < 0 on error. | ||
| 1999 | * | ||
| 2000 | * Called from security/selinux/avc.c::avc_audit() | ||
| 2001 | */ | ||
| 2002 | int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt) | ||
| 2003 | { | ||
| 2004 | struct audit_aux_data_path *ax; | ||
| 2005 | struct audit_context *context = current->audit_context; | ||
| 2006 | |||
| 2007 | if (likely(!context)) | ||
| 2008 | return 0; | ||
| 2009 | |||
| 2010 | ax = kmalloc(sizeof(*ax), GFP_ATOMIC); | ||
| 2011 | if (!ax) | ||
| 2012 | return -ENOMEM; | ||
| 2013 | |||
| 2014 | ax->dentry = dget(dentry); | ||
| 2015 | ax->mnt = mntget(mnt); | ||
| 2016 | |||
| 2017 | ax->d.type = AUDIT_AVC_PATH; | ||
| 2018 | ax->d.next = context->aux; | ||
| 2019 | context->aux = (void *)ax; | ||
| 2020 | return 0; | ||
| 2021 | } | ||
| 2022 | |||
| 2023 | /** | ||
| 2024 | * audit_signal_info - record signal info for shutting down audit subsystem | 1977 | * audit_signal_info - record signal info for shutting down audit subsystem |
| 2025 | * @sig: signal value | 1978 | * @sig: signal value |
| 2026 | * @t: task being signaled | 1979 | * @t: task being signaled |
