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] [day] [month] [year] [list]
Date:	Thu, 17 Dec 2009 18:13:09 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	prasad@...ux.vnet.ibm.com
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	"mingo@...e.hu" <mingo@...e.hu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [Bug][perf hw-breakpoints] Null pointer exception when using
 register_user_hw_breakpoint with inherit flag

On Thu, 2009-12-17 at 22:33 +0530, K.Prasad wrote:
> Hi,
>   While testing out two new interfaces (to be sent separately) that
> in-turn uses register_user_hw_breakpoint() and unregister_hw_breakpoint(),
> I noticed the following error.
> 
> The bug is seen only when 'inherit' flag of 'perf_event_attr' is set
> (not otherwise) before the call to register_user_hw_breakpoint(),
> and when the user-space process tries to spawn a new thread.
> 
> Please find the screen logs taken from an x86 box, running -tip kernel 
> commit 7818b3d0fc68f5c2a85fed86d9fa37131c5a3068.
> 
> Digging further, the causative line of code appears to be
> 
> 	atomic_long_inc(&parent_event->filp->f_count);
> 
> in inherit_event() function, wherein f_count is NULL (and hence the
> error). I haven't analysed further to understand why/if the said
> pointer is/should be NULL.
> 
> Thought might bring it to the community's notice for wider
> notice/further investigation.

Ooh, cute, it seems the inherit code assumes we have a file structure
around, which isn't true for events that get created through the kernel
interface.

I think its a simple matter of testing to see if event->filp is set, but
we'd better audit the code for it.

--
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