From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14053 invoked by alias); 24 Feb 2006 00:56:52 -0000 Received: (qmail 14045 invoked by uid 22791); 24 Feb 2006 00:56:51 -0000 X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from fmr19.intel.com (HELO orsfmr004.jf.intel.com) (134.134.136.18) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Feb 2006 00:56:50 +0000 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id k1O0umeQ009720 for ; Fri, 24 Feb 2006 00:56:48 GMT Received: from pdsmsxvs01.pd.intel.com (pdsmsxvs01.pd.intel.com [172.16.12.122]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id k1O0ugd3029461 for ; Fri, 24 Feb 2006 00:56:48 GMT Received: from pdsmsx331.ccr.corp.intel.com ([172.16.12.58]) by pdsmsxvs01.pd.intel.com (SAVSMTP 3.1.7.47) with SMTP id M2006022408564718921 for ; Fri, 24 Feb 2006 08:56:47 +0800 Received: from pdsmsx405.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx331.ccr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 24 Feb 2006 08:56:47 +0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Subject: RE: Kprobes might be stealing int3 Date: Fri, 24 Feb 2006 00:56:00 -0000 Message-ID: <9FBCE015AF479F46B3B410499F3AE05B0898FC@pdsmsx405> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Kprobes might be stealing int3 Thread-Index: AcY4tTlwadEQOj1bQk+R2qopg+jFHgAG+3fgAAKsUsA= From: "Mao, Bibo" To: "Keshavamurthy, Anil S" Cc: X-OriginalArrivalTime: 24 Feb 2006 00:56:47.0246 (UTC) FILETIME=[30183AE0:01C638DD] X-Scanned-By: MIMEDefang 2.52 on 10.7.209.17 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00609.txt.bz2 Anil, I search the x86 assembly manual, about INT instruction there are three kin= ds: CC INT 3 Interrupt 3=A1=AAtrap to debugger CD ib INT imm8 Interrupt vector number specified by immediate byte CE INTO Interrupt 4=A1=AAif overflow flag is 1 So like this test program, the instruction encoding will be 0x03cd, it has = the same effect with 0xcc encoding.=20 And currently in kprobe BREAK_INSTRUCTION is only defined as 0xcc. Maybe an= other encoding also need be judged. Thanks bibo,mao >-----Original Message----- >From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.or= g] >On Behalf Of Keshavamurthy, Anil S >Sent: 2006=C4=EA2=D4=C224=C8=D5 7:34 >To: systemtap@sources.redhat.com >Subject: FW: Kprobes might be stealing int3 > >I went little further and found why the application is segmentation >fault'ing. > >In the kprobes_handler() code, we are checking >If (*addr !=3D BREAK_INSTRUCTION) and this is where the >app is crashing since we are trying to dereference this address >which is not a linear address. > >I would be happy to tryout any fix that any one provides. > >Thanks, >Anil >-----Original Message----- >From: Keshavamurthy Anil S [mailto:anil.s.keshavamurthy@intel.com] >Sent: Thursday, February 23, 2006 12:11 PM >To: Systemtap >Cc: Keshavamurthy, Anil S >Subject: Kprobes might be stealing int3 > >Hi, > I tried running the below program on both >x86_64 and i386 and on both architecture, >if the kernel is compiled with CONFIG_KPROBES, >my below application segmentation faults. > >On kernel where CONFIG_KPROBES set to N, the >same test program passes. > >Here goes the test program... >------------------------- >#include >#include > >void my_trap(int sig) >{ > printf("Test passed, all OK\n"); > exit(0); >} > >int main() >{ > signal(SIGTRAP, my_trap); > asm volatile (".byte 0xcd,3"); > printf("Stolen interrupt, very bad!\n"); >} >---------------------------------- > > > > > >