aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-26 12:04:57 +0100
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-26 12:04:57 +0100
commit7551ced334ce6eb2a7a765309871e619f645add1 (patch)
treeb34088792efdf335e6a2c02a9c97768da84a695a /kernel
parentAUDIT: Fix remaining cases of direct logging of untrusted strings by avc_audit (diff)
downloadlinux-dev-7551ced334ce6eb2a7a765309871e619f645add1.tar.xz
linux-dev-7551ced334ce6eb2a7a765309871e619f645add1.zip
AUDIT: Defer freeing aux items until audit_free_context()
While they were all just simple blobs it made sense to just free them as we walked through and logged them. Now that there are pointers to other objects which need refcounting, we might as well revert to _only_ logging them in audit_log_exit(), and put the code to free them properly in only one place -- in audit_free_aux(). Signed-off-by: David Woodhouse <dwmw2@infradead.org> ----------------------------------------------------------
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditsc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index b45677eba78f..7556c479d5af 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -675,6 +675,7 @@ static void audit_log_exit(struct audit_context *context)
{
int i;
struct audit_buffer *ab;
+ struct audit_aux_data *aux;
ab = audit_log_start(context, AUDIT_SYSCALL);
if (!ab)
@@ -705,10 +706,8 @@ static void audit_log_exit(struct audit_context *context)
context->egid, context->sgid, context->fsgid);
audit_log_task_info(ab);
audit_log_end(ab);
- while (context->aux) {
- struct audit_aux_data *aux;
- aux = context->aux;
+ for (aux = context->aux; aux; aux = aux->next) {
ab = audit_log_start(context, aux->type);
if (!ab)
@@ -740,15 +739,10 @@ static void audit_log_exit(struct audit_context *context)
case AUDIT_AVC_PATH: {
struct audit_aux_data_path *axi = (void *)aux;
audit_log_d_path(ab, "path=", axi->dentry, axi->mnt);
- dput(axi->dentry);
- mntput(axi->mnt);
break; }
}
audit_log_end(ab);
-
- context->aux = aux->next;
- kfree(aux);
}
for (i = 0; i < context->name_count; i++) {