summaryrefslogtreecommitdiff
path: root/kernel/audit_watch.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2017-08-29 14:33:50 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2017-08-29 14:33:50 +0200
commit2e8f1517cf68d8bd81b33f1585c16228dbd0d7c6 (patch)
tree4cbca18a4c67e461de5c3e0b65ef5fdc542fa0e6 /kernel/audit_watch.c
parentefc949fedd30023a30ea34586b485554932c878f (diff)
parent982ce2aa79fbe7c961ee948857d5b5b2a0b2ddd9 (diff)
Merge 4.4.84 into android-4.4
Changes in 4.4.84 netfilter: nf_ct_ext: fix possible panic after nf_ct_extend_unregister audit: Fix use after free in audit_remove_watch_rule() parisc: pci memory bar assignment fails with 64bit kernels on dino/cujo crypto: x86/sha1 - Fix reads beyond the number of blocks passed Input: elan_i2c - add ELAN0608 to the ACPI table Input: elan_i2c - Add antoher Lenovo ACPI ID for upcoming Lenovo NB ALSA: seq: 2nd attempt at fixing race creating a queue ALSA: usb-audio: Apply sample rate quirk to Sennheiser headset ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices mm/mempolicy: fix use after free when calling get_mempolicy mm: revert x86_64 and arm64 ELF_ET_DYN_BASE base changes xen: fix bio vec merging x86/asm/64: Clear AC on NMI entries irqchip/atmel-aic: Fix unbalanced of_node_put() in aic_common_irq_fixup() irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup() Sanitize 'move_pages()' permission checks pids: make task_tgid_nr_ns() safe perf/x86: Fix LBR related crashes on Intel Atom usb: optimize acpi companion search for usb port devices usb: qmi_wwan: add D-Link DWM-222 device ID Linux 4.4.84 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'kernel/audit_watch.c')
-rw-r--r--kernel/audit_watch.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
index 939945a5649c..a162661c9d60 100644
--- a/kernel/audit_watch.c
+++ b/kernel/audit_watch.c
@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule)
list_del(&krule->rlist);
if (list_empty(&watch->rules)) {
+ /*
+ * audit_remove_watch() drops our reference to 'parent' which
+ * can get freed. Grab our own reference to be safe.
+ */
+ audit_get_parent(parent);
audit_remove_watch(watch);
-
- if (list_empty(&parent->watches)) {
- audit_get_parent(parent);
+ if (list_empty(&parent->watches))
fsnotify_destroy_mark(&parent->mark, audit_watch_group);
- audit_put_parent(parent);
- }
+ audit_put_parent(parent);
}
}