Skip to content

Commit 8e0cd95

Browse files
committed
Merge tag 'audit-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit updates from Paul Moore: "Two patches in the audit pull request for v5.15; one is trivial ("header protection") but the second is a real patch that fixes a refcounting problem. The refcount fix normally would have been sent up during the -rcX cycle, but since we merged it less than a week before v5.14 proper I felt it was better to wait for the merge window to open; the patch is marked with the usual -stable markings" * tag 'audit-pr-20210830' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: move put_tree() to avoid trim_trees refcount underflow and UAF audit: add header protection to kernel/audit.h
2 parents befa491 + 67d69e9 commit 8e0cd95

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

kernel/audit.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* Copyright 2005 IBM Corporation
77
*/
88

9+
#ifndef _KERNEL_AUDIT_H_
10+
#define _KERNEL_AUDIT_H_
11+
912
#include <linux/fs.h>
1013
#include <linux/audit.h>
1114
#include <linux/skbuff.h>
@@ -331,3 +334,5 @@ extern int audit_filter(int msgtype, unsigned int listtype);
331334

332335
extern void audit_ctl_lock(void);
333336
extern void audit_ctl_unlock(void);
337+
338+
#endif

kernel/audit_tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,6 @@ static void prune_tree_chunks(struct audit_tree *victim, bool tagged)
593593
spin_lock(&hash_lock);
594594
}
595595
spin_unlock(&hash_lock);
596-
put_tree(victim);
597596
}
598597

599598
/*
@@ -602,6 +601,7 @@ static void prune_tree_chunks(struct audit_tree *victim, bool tagged)
602601
static void prune_one(struct audit_tree *victim)
603602
{
604603
prune_tree_chunks(victim, false);
604+
put_tree(victim);
605605
}
606606

607607
/* trim the uncommitted chunks from tree */

0 commit comments

Comments
 (0)