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: <928CFBE8E7CB0040959E56B4EA41A77E92607ED7@irsmsx504.ger.corp.intel.com>
Date:	Wed, 25 Mar 2009 09:07:41 +0000
From:	"Metzger, Markus T" <markus.t.metzger@...el.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"hpa@...or.com" <hpa@...or.com>,
	"markus.t.metzger@...il.com" <markus.t.metzger@...il.com>,
	"roland@...hat.com" <roland@...hat.com>,
	"eranian@...glemail.com" <eranian@...glemail.com>,
	"oleg@...hat.com" <oleg@...hat.com>,
	"Villacis, Juan" <juan.villacis@...el.com>,
	"ak@...ux.jf.intel.com" <ak@...ux.jf.intel.com>
Subject: RE: [patch] x86, bts: use atomic memory allocation

>-----Original Message-----
>From: Ingo Molnar [mailto:mingo@...e.hu]
>Sent: Friday, March 20, 2009 7:56 PM
>To: Metzger, Markus T


>> >> Ds_request_bts() needs to allocate memory. It uses GFP_KERNEL.
>> >>
>> >> Hw-branch-tracer calls ds_request_bts() within on_each_cpu().
>> >>
>> >> Use atomic memory allocation to allow it to be used in that context.
>> >
>> >the hw-branch-tracer still crashes during bootup. Have you tried the
>> >config i sent to you, and have you tried to reproduce it? I've
>> >attached another config that crashes.
>>
>> The first config boots OK.
>
>> The second config boots OK with the additional changes to keep the
>> GFP_KERNEL and move the ds_request_bts() calls out of the
>> on_each_cpu() in the hw-branch-tracer.
>>
>> I don't know yet what exactly causes the crash and if there is a
>> simpler fix.
>
>hm, this was an AMD box - so perhaps they dont have a compatible DS
>implementation?

If no trace hardware is detected, the hw-branch tracer returns -EOPNOTSUPP.
I doubt that there is an incompatible DS implementation.


I found a bug that leads to a kernel crash.

If the tracing task exits, it disables bts tracing for all its children and then
frees the trace buffer. If the children are currently executing, the buffer
may be freed while the hardware is still tracing. This might cause the hardware to
overwrite memory.

I would need to wait until the traced task is rescheduled, trigger a rescheduling,
or actively disable tracing on the traced task's cpu.

Unfortunately, most of the ptrace exit code is executed with irq's disabled and
tasklist_lock write-held.
I am currently trying to find a way to do this at a time when irq's are enabled.

This affects the ptrace bts extension for .29 and tip/tracing/hw-branch-tracing.
The hw-branch-tracer is not affected.


regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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