Skip to content

Commit 290fe0f

Browse files
committed
Merge tag 'audit-pr-20210629' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit updates from Paul Moore: "Another merge window, another small audit pull request. Four patches in total: one is cosmetic, one removes an unnecessary initialization, one renames some enum values to prevent name collisions, and one converts list_del()/list_add() to list_move(). None of these are earth shattering and all pass the audit-testsuite tests while merging cleanly on top of your tree from earlier today" * tag 'audit-pr-20210629' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: remove unnecessary 'ret' initialization audit: remove trailing spaces and tabs audit: Use list_move instead of list_del/list_add audit: Rename enum audit_state constants to avoid AUDIT_DISABLED redefinition audit: add blank line after variable declarations
2 parents 6bd344e + 0ecc617 commit 290fe0f

File tree

5 files changed

+53
-37
lines changed

5 files changed

+53
-37
lines changed

include/uapi/linux/audit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* 2500 - 2999 future user space (maybe integrity labels and related events)
4949
*
5050
* Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
51-
* exclusively user space. 1300-2099 is kernel --> user space
51+
* exclusively user space. 1300-2099 is kernel --> user space
5252
* communication.
5353
*/
5454
#define AUDIT_GET 1000 /* Get status */
@@ -78,7 +78,7 @@
7878
#define AUDIT_LAST_USER_MSG 1199
7979
#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
8080
#define AUDIT_LAST_USER_MSG2 2999
81-
81+
8282
#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
8383
#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
8484
#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */

kernel/audit.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
2-
/* audit -- definition of audit_context structure and supporting types
2+
/* audit -- definition of audit_context structure and supporting types
33
*
44
* Copyright 2003-2004 Red Hat, Inc.
55
* Copyright 2005 Hewlett-Packard Development Company, L.P.
@@ -21,16 +21,16 @@
2121
a per-task filter. At syscall entry, the audit_state is augmented by
2222
the syscall filter. */
2323
enum audit_state {
24-
AUDIT_DISABLED, /* Do not create per-task audit_context.
24+
AUDIT_STATE_DISABLED, /* Do not create per-task audit_context.
2525
* No syscall-specific audit records can
2626
* be generated. */
27-
AUDIT_BUILD_CONTEXT, /* Create the per-task audit_context,
27+
AUDIT_STATE_BUILD, /* Create the per-task audit_context,
2828
* and fill it in at syscall
2929
* entry time. This makes a full
3030
* syscall record available if some
3131
* other part of the kernel decides it
3232
* should be recorded. */
33-
AUDIT_RECORD_CONTEXT /* Create the per-task audit_context,
33+
AUDIT_STATE_RECORD /* Create the per-task audit_context,
3434
* always fill it in at syscall entry
3535
* time, and always write out the audit
3636
* record at syscall exit time. */
@@ -322,7 +322,7 @@ static inline int audit_signal_info_syscall(struct task_struct *t)
322322
return 0;
323323
}
324324

325-
#define audit_filter_inodes(t, c) AUDIT_DISABLED
325+
#define audit_filter_inodes(t, c) AUDIT_STATE_DISABLED
326326
#endif /* CONFIG_AUDITSYSCALL */
327327

328328
extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len);

kernel/audit_tree.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,7 @@ void audit_trim_trees(void)
689689

690690
tree = container_of(cursor.next, struct audit_tree, list);
691691
get_tree(tree);
692-
list_del(&cursor);
693-
list_add(&cursor, &tree->list);
692+
list_move(&cursor, &tree->list);
694693
mutex_unlock(&audit_filter_mutex);
695694

696695
err = kern_path(tree->pathname, 0, &path);
@@ -899,8 +898,7 @@ int audit_tag_tree(char *old, char *new)
899898

900899
tree = container_of(cursor.next, struct audit_tree, list);
901900
get_tree(tree);
902-
list_del(&cursor);
903-
list_add(&cursor, &tree->list);
901+
list_move(&cursor, &tree->list);
904902
mutex_unlock(&audit_filter_mutex);
905903

906904
err = kern_path(tree->pathname, 0, &path2);
@@ -925,8 +923,7 @@ int audit_tag_tree(char *old, char *new)
925923
mutex_lock(&audit_filter_mutex);
926924
spin_lock(&hash_lock);
927925
if (!tree->goner) {
928-
list_del(&tree->list);
929-
list_add(&tree->list, &tree_list);
926+
list_move(&tree->list, &tree_list);
930927
}
931928
spin_unlock(&hash_lock);
932929
put_tree(tree);
@@ -937,8 +934,7 @@ int audit_tag_tree(char *old, char *new)
937934

938935
tree = container_of(barrier.prev, struct audit_tree, list);
939936
get_tree(tree);
940-
list_del(&tree->list);
941-
list_add(&tree->list, &barrier);
937+
list_move(&tree->list, &barrier);
942938
mutex_unlock(&audit_filter_mutex);
943939

944940
if (!failed) {

0 commit comments

Comments
 (0)