Commit 290fe0fa authored by Linus Torvalds's avatar Linus Torvalds

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
parents 6bd344e5 0ecc6178
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
* 2500 - 2999 future user space (maybe integrity labels and related events) * 2500 - 2999 future user space (maybe integrity labels and related events)
* *
* Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
* exclusively user space. 1300-2099 is kernel --> user space * exclusively user space. 1300-2099 is kernel --> user space
* communication. * communication.
*/ */
#define AUDIT_GET 1000 /* Get status */ #define AUDIT_GET 1000 /* Get status */
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
#define AUDIT_LAST_USER_MSG 1199 #define AUDIT_LAST_USER_MSG 1199
#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
#define AUDIT_LAST_USER_MSG2 2999 #define AUDIT_LAST_USER_MSG2 2999
#define AUDIT_DAEMON_START 1200 /* Daemon startup record */ #define AUDIT_DAEMON_START 1200 /* Daemon startup record */
#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */ #define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
......
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* SPDX-License-Identifier: GPL-2.0-or-later */
/* audit -- definition of audit_context structure and supporting types /* audit -- definition of audit_context structure and supporting types
* *
* Copyright 2003-2004 Red Hat, Inc. * Copyright 2003-2004 Red Hat, Inc.
* Copyright 2005 Hewlett-Packard Development Company, L.P. * Copyright 2005 Hewlett-Packard Development Company, L.P.
...@@ -21,16 +21,16 @@ ...@@ -21,16 +21,16 @@
a per-task filter. At syscall entry, the audit_state is augmented by a per-task filter. At syscall entry, the audit_state is augmented by
the syscall filter. */ the syscall filter. */
enum audit_state { enum audit_state {
AUDIT_DISABLED, /* Do not create per-task audit_context. AUDIT_STATE_DISABLED, /* Do not create per-task audit_context.
* No syscall-specific audit records can * No syscall-specific audit records can
* be generated. */ * be generated. */
AUDIT_BUILD_CONTEXT, /* Create the per-task audit_context, AUDIT_STATE_BUILD, /* Create the per-task audit_context,
* and fill it in at syscall * and fill it in at syscall
* entry time. This makes a full * entry time. This makes a full
* syscall record available if some * syscall record available if some
* other part of the kernel decides it * other part of the kernel decides it
* should be recorded. */ * should be recorded. */
AUDIT_RECORD_CONTEXT /* Create the per-task audit_context, AUDIT_STATE_RECORD /* Create the per-task audit_context,
* always fill it in at syscall entry * always fill it in at syscall entry
* time, and always write out the audit * time, and always write out the audit
* record at syscall exit time. */ * record at syscall exit time. */
...@@ -322,7 +322,7 @@ static inline int audit_signal_info_syscall(struct task_struct *t) ...@@ -322,7 +322,7 @@ static inline int audit_signal_info_syscall(struct task_struct *t)
return 0; return 0;
} }
#define audit_filter_inodes(t, c) AUDIT_DISABLED #define audit_filter_inodes(t, c) AUDIT_STATE_DISABLED
#endif /* CONFIG_AUDITSYSCALL */ #endif /* CONFIG_AUDITSYSCALL */
extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len); extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len);
......
...@@ -689,8 +689,7 @@ void audit_trim_trees(void) ...@@ -689,8 +689,7 @@ void audit_trim_trees(void)
tree = container_of(cursor.next, struct audit_tree, list); tree = container_of(cursor.next, struct audit_tree, list);
get_tree(tree); get_tree(tree);
list_del(&cursor); list_move(&cursor, &tree->list);
list_add(&cursor, &tree->list);
mutex_unlock(&audit_filter_mutex); mutex_unlock(&audit_filter_mutex);
err = kern_path(tree->pathname, 0, &path); err = kern_path(tree->pathname, 0, &path);
...@@ -899,8 +898,7 @@ int audit_tag_tree(char *old, char *new) ...@@ -899,8 +898,7 @@ int audit_tag_tree(char *old, char *new)
tree = container_of(cursor.next, struct audit_tree, list); tree = container_of(cursor.next, struct audit_tree, list);
get_tree(tree); get_tree(tree);
list_del(&cursor); list_move(&cursor, &tree->list);
list_add(&cursor, &tree->list);
mutex_unlock(&audit_filter_mutex); mutex_unlock(&audit_filter_mutex);
err = kern_path(tree->pathname, 0, &path2); err = kern_path(tree->pathname, 0, &path2);
...@@ -925,8 +923,7 @@ int audit_tag_tree(char *old, char *new) ...@@ -925,8 +923,7 @@ int audit_tag_tree(char *old, char *new)
mutex_lock(&audit_filter_mutex); mutex_lock(&audit_filter_mutex);
spin_lock(&hash_lock); spin_lock(&hash_lock);
if (!tree->goner) { if (!tree->goner) {
list_del(&tree->list); list_move(&tree->list, &tree_list);
list_add(&tree->list, &tree_list);
} }
spin_unlock(&hash_lock); spin_unlock(&hash_lock);
put_tree(tree); put_tree(tree);
...@@ -937,8 +934,7 @@ int audit_tag_tree(char *old, char *new) ...@@ -937,8 +934,7 @@ int audit_tag_tree(char *old, char *new)
tree = container_of(barrier.prev, struct audit_tree, list); tree = container_of(barrier.prev, struct audit_tree, list);
get_tree(tree); get_tree(tree);
list_del(&tree->list); list_move(&tree->list, &barrier);
list_add(&tree->list, &barrier);
mutex_unlock(&audit_filter_mutex); mutex_unlock(&audit_filter_mutex);
if (!failed) { if (!failed) {
......
This diff is collapsed.
...@@ -119,7 +119,6 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb, ...@@ -119,7 +119,6 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb,
return -EINVAL; return -EINVAL;
ad->u.net->v6info.saddr = ip6->saddr; ad->u.net->v6info.saddr = ip6->saddr;
ad->u.net->v6info.daddr = ip6->daddr; ad->u.net->v6info.daddr = ip6->daddr;
ret = 0;
/* IPv6 can have several extension header before the Transport header /* IPv6 can have several extension header before the Transport header
* skip them */ * skip them */
offset = skb_network_offset(skb); offset = skb_network_offset(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment