Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbaBWODC (ORCPT ); Sun, 23 Feb 2014 09:03:02 -0500 Received: from mail-qg0-f45.google.com ([209.85.192.45]:42758 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117AbaBWODA (ORCPT ); Sun, 23 Feb 2014 09:03:00 -0500 Date: Sun, 23 Feb 2014 09:05:01 -0500 (EST) From: Vince Weaver To: "H. Peter Anvin" cc: Vince Weaver , Linux Kernel , Peter Zijlstra , Ingo Molnar , "H.J. Lu" Subject: Re: perf_fuzzer compiled for x32 causes reboot In-Reply-To: Message-ID: References: <53084317.4090304@zytor.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Feb 2014, H. Peter Anvin wrote: > I'd be interested in how rbp gets set, too. It might just be a > coincidence and the value in rbp has some other meaning here. The code in question does this: i=find_random_active_event(); if (i<0) return; if ((event_data[i].mmap)) { value=0xdeadbeef; memset(event_data[i].mmap,value,getpagesize()); [New LWP 10526] Core was generated by `./perf_fuzzer -t OCIRMQWPpAi -r 1392938876'. Program terminated with signal 11, Segmentation fault. #0 0x0041efab in __memset_sse2 () (gdb) bt #0 0x0041efab in __memset_sse2 () #1 0x004017ec in trash_random_mmap () at perf_fuzzer.c:808 #2 main (argc=, argv=) at perf_fuzzer.c:1604 So rbp is set by the imul below, it is the offset into the event_data[i] array where the elements have size of 0x120 0x004017bd <+3085>: callq 0x402ee0 0x004017c2 <+3090>: test %eax,%eax 0x004017c4 <+3092>: js 0x4011e8 0x004017ca <+3098>: imul $0x120,%eax,%ebp 0x004017d0 <+3104>: mov 0x756b2c(%ebp),%eax 0x004017d7 <+3111>: test %eax,%eax 0x004017d9 <+3113>: je 0x40183b 0x004017db <+3115>: mov 0xc(%esp),%edx 0x004017e0 <+3120>: mov %eax,%edi 0x004017e2 <+3122>: mov $0xdeadbeef,%esi 0x004017e7 <+3127>: callq 0x400260 0x004017ec <+3132>: testb $0x20,0x353e76(%rip) # 0x755669 : cmp $0x1,%rdx 0x0041e714 <+4>: mov %rdi,%rax 0x0041e717 <+7>: jne 0x41e71d <__memset_sse2+13> 0x0041e719 <+9>: mov %sil,(%rdi) and as far as I can tell nothing touches rbp again until the segfault. Nothing in _memset_sse2 does as far as I can tell. Vince -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/