lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20181103022546.GA1404@jeantsuru-pc>
Date:   Sat, 3 Nov 2018 11:25:46 +0900
From:   Takeshi Misawa <jeliantsurux@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...hat.com>
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] trace: fix memory leak in create_filter()

In create_filter(), pe variable is leaked.

Since commit 80765597bc58 ("tracing: Rewrite filter logic to be simpler
and faster"), create_filter_finish() is missing.

kmemleak:

unreferenced object 0xffff90148ba9c790 (size 8):
  comm "bash", pid 1378, jiffies 4294731025 (age 15.258s)
  hex dump (first 8 bytes):
    00 00 00 00 00 00 00 00                          ........
  backtrace:
    [<00000000d9a25450>] create_filter+0x47/0xc0
    [<0000000084514f08>] set_trigger_filter+0x87/0x130
    [<0000000017f6c9ef>] event_trigger_callback+0x114/0x220
    [<000000005096f447>] event_trigger_write+0x113/0x1b0
    [<00000000a5f767d1>] __vfs_write+0x36/0x1a0
    [<00000000ca62b71e>] vfs_write+0xa5/0x1a0
    [<00000000fdbd8005>] ksys_write+0x4f/0xb0
    [<00000000ec6e3711>] do_syscall_64+0x5b/0x160
    [<000000003ad36bb4>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [<000000007a35f0f5>] 0xffffffffffffffff

Fix this.

Signed-off-by: Takeshi Misawa <jeliantsurux@...il.com>
---
I found kmemleak in tracing subsystem.
Please consider this patch.

Regards.
---
 kernel/trace/trace_events_filter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 84a65173b1e9..fb4ba08163ba 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1719,6 +1719,8 @@ static int create_filter(struct trace_event_call *call,
 	if (err && set_str)
 		append_filter_err(pe, *filterp);
 
+	create_filter_finish(pe);
+
 	return err;
 }
 
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ