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:	Wed, 26 Nov 2008 21:56:19 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	eranian@...il.com
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, mingo@...e.hu, x86@...nel.org,
	sfr@...b.auug.org.au
Subject: Re: [patch 23/24] perfmon: kernel documentation

On Wed, Nov 26, 2008 at 09:24:59PM +0100, stephane eranian wrote:
> 
> >> I have never played with that myself, even with regular file
> >> descriptors. But I can only
> >> assume passing a file descriptor increments its refcount. Thus you
> >> simply get another
> >> controlling process. There is enough context locking in place in the
> >> kernel to make this
> >> work.
> >
> > Ok as long as it isn't a root hole or similar.
> >
> I need to figure out how you actually pass a fd form one process to another.
> I seem to remember you need a pipe or socket + some ioctl().

Unix sockets and the SCM_RIGHTS auxilliary message. See man 7 unix  

> But then, there is one issue with RDPMC which is not clearly stated in the SDM
> if I recall. Take Core 2, counters are 40 bits, thus RDPMC returns 40-bit worth
> of data. But wrmsrl() can only set the bottom 32 bits. Bits 32-39 are
> sign extension

For this usecase wrmsrl is not really needed, it would be just a free 
running counter like the TSC.

> of bit 31. Thus, you may need some masking in case the counter is high.  On
> Intel processors, perfmon considers that all counters are actually 31-bit wide
> (bits 32 and up are always set) and they are all virtualized to 64-bit via the
> overflow interrupt. The issue with RDPMC vs. wrmsrl() is important in per-thread
> mode because on context switch we may have to restore the counter.

Ok is there a simple way currently to just enable the counter?

> If we all agree on this, I can have the kernel adjust the limit based
> on the number
> of registers. We would not necessarily need to expose that limit in
> /sys, if we assume
> that tools will never try to pass vector with more entries than there
> are registers. And if
> they do, the call will fail.

I would suggest to just hardcode PAGE_SIZE and only worry about
it again if really some driver exceeds it.

-Andi

-- 
ak@...ux.intel.com
--
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