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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1405271549100.4124@vincent-weaver-1.umelst.maine.edu>
Date:	Tue, 27 May 2014 15:52:19 -0400 (EDT)
From:	Vince Weaver <vincent.weaver@...ne.edu>
To:	Vince Weaver <vincent.weaver@...ne.edu>
cc:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Paul Mackerras <paulus@...ba.org>
Subject: Re: perf: fuzzer getting stuck with slow memory leak

On Tue, 27 May 2014, Vince Weaver wrote:

>      perf_fuzzer-2989  [001]  1994.514398: sys_enter:		NR 298 (699f28, bad, 0, ffffffff, 2, 7fff361a3360)
>      perf_fuzzer-2989  [001]  1994.514399: bprint:		SYSC_perf_event_open: VMW: perf_event_open type=1 config=8 period=0 pid=2989 cpu=0 group=-1 flags=2
>      perf_fuzzer-2989  [001]  1994.514400: kmalloc:		(T.1267+0xe) call_site=ffffffff810d027d ptr=0xffff880119d1f400 bytes_req=936 bytes_alloc=1024 gfp_flags=GFP_KERNEL|GFP_ZERO
>      perf_fuzzer-2989  [001]  1994.514401: kmalloc:		(T.1267+0xe) call_site=ffffffff810d027d ptr=0xffff8800cbbbd000 bytes_req=2064 bytes_alloc=4096 gfp_flags=GFP_KERNEL|GFP_ZERO
>      perf_fuzzer-2989  [001]  1994.514401: kmalloc:     	(T.1267+0xe) call_site=ffffffff810d027d ptr=0xffff880119fcd000 bytes_req=2064 bytes_alloc=4096 gfp_flags=GFP_KERNEL|GFP_ZERO
>      perf_fuzzer-2989  [001]  1994.514402: kmalloc:		(T.1267+0xe) call_site=ffffffff810d027d ptr=0xffff8800c9344400 bytes_req=216 bytes_alloc=256 gfp_flags=GFP_KERNEL|GFP_ZERO
> 	(repeat forever)

OK, the problem is in:

	kernel/events/core.c find_get_context()

retry:
	perf_lock_task_context() returns NULL.
	alloc_perf_context()
	task->perf_event_ctxp[ctxn] is *not* NULL
	err == EAGAIN so jump to retry

stuck forever leaking the memory being allocated by alloc_perf_context().

I'm not sure what this code should be doing, but it looks like we'll 
always leak memory if the EAGAIN case is triggered?

Vince

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ