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: <928CFBE8E7CB0040959E56B4EA41A77E9BB0D3AA@irsmsx504.ger.corp.intel.com>
Date:	Mon, 27 Apr 2009 07:35:16 +0100
From:	"Metzger, Markus T" <markus.t.metzger@...el.com>
To:	Andi Kleen <ak@...ux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: RE: [rfc 2/2] x86, bts: use physically non-contiguous trace buffer

>-----Original Message-----
>From: Andi Kleen [mailto:ak@...ux.intel.com]
>Sent: Saturday, April 25, 2009 8:41 AM
>To: Metzger, Markus T; Linux Kernel Mailing List
>Subject: Re: [rfc 2/2] x86, bts: use physically non-contiguous trace buffer
>
>Markus Metzger wrote:
>> Use vmalloc to allocate the branch trace buffer.
>>
>> Peter Zijlstra suggested to use vmalloc rather than kmalloc to
>> allocate the potentially multi-page branch trace buffer.
>>
>> Is there a way to have vmalloc allocate a physically non-contiguous
>> buffer for test purposes? Ideally, the memory area would have big
>> holes in it with sensitive data in between so I would know immediately
>> when this is overwritten.
>
>For test purposes you could hack vmalloc.c to allocate more pages
>and only put in every second/third/... into the mapping. You would
>just need to add another to loop to __vmalloc_area_node() that allocates
>more. That should give you non continuous mappings unless you're really unlucky.

Thanks.

I got enough feedback that the existing method is preferable to using vmalloc
that I dropped it again.

regards,
markus.


>
>-Andi
>
>
>>
>>
>> Reported-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
>> CC: Andrew Morton <akpm@...ux-foundation.org>
>> Signed-off-by: Markus Metzger <markus.t.metzger@...el.com>
>> ---
>>  arch/x86/kernel/ptrace.c |    5 	3 +	2 -	0 !
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> Index: b/arch/x86/kernel/ptrace.c
>> ===================================================================
>> --- a/arch/x86/kernel/ptrace.c
>> +++ b/arch/x86/kernel/ptrace.c
>> @@ -22,6 +22,7 @@
>>  #include <linux/seccomp.h>
>>  #include <linux/signal.h>
>>  #include <linux/workqueue.h>
>> +#include <linux/vmalloc.h>
>>
>>  #include <asm/uaccess.h>
>>  #include <asm/pgtable.h>
>> @@ -626,7 +627,7 @@ static int alloc_bts_buffer(struct bts_c
>>  	if (err < 0)
>>  		return err;
>>
>> -	buffer = kzalloc(size, GFP_KERNEL);
>> +	buffer = vmalloc(size);
>>  	if (!buffer)
>>  		goto out_refund;
>>
>> @@ -646,7 +647,7 @@ static inline void free_bts_buffer(struc
>>  	if (!context->buffer)
>>  		return;
>>
>> -	kfree(context->buffer);
>> +	vfree(context->buffer);
>>  	context->buffer = NULL;
>>
>>  	refund_locked_memory(context->mm, context->size);

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