From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759134AbdJQHuq (ORCPT ); Tue, 17 Oct 2017 03:50:46 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54893 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759119AbdJQHup (ORCPT ); Tue, 17 Oct 2017 03:50:45 -0400 Date: Tue, 17 Oct 2017 09:50:04 +0200 (CEST) From: Thomas Gleixner To: Joonsoo Kim cc: Josh Poimboeuf , kernel test robot , Ingo Molnar , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Jiri Slaby , Linus Torvalds , Mike Galbraith , Peter Zijlstra , LKML , lkp@01.org, linux-mm@kvack.org, Pekka Enberg , David Rientjes , Andrew Morton , Christoph Lameter Subject: Re: [lkp-robot] [x86/kconfig] 81d3871900: BUG:unable_to_handle_kernel In-Reply-To: <20171017073326.GA23865@js1304-P5Q-DELUXE> Message-ID: References: <20171010121513.GC5445@yexl-desktop> <20171011023106.izaulhwjcoam55jt@treble> <20171011170120.7flnk6r77dords7a@treble> <20171017073326.GA23865@js1304-P5Q-DELUXE> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 Tue, 17 Oct 2017, Joonsoo Kim wrote: > On Wed, Oct 11, 2017 at 12:01:20PM -0500, Josh Poimboeuf wrote: > > > Looking at the panic, the code in slob_free() was: > > > > > > 0: e8 8d f7 ff ff callq 0xfffffffffffff792 > > > 5: 48 ff 05 c9 8c 91 02 incq 0x2918cc9(%rip) # 0x2918cd5 > > > c: 85 c0 test %eax,%eax > > > e: 75 51 jne 0x61 > > > 10: 49 0f bf c5 movswq %r13w,%rax > > > 14: 48 ff 05 c2 8c 91 02 incq 0x2918cc2(%rip) # 0x2918cdd > > > 1b: 48 8d 3c 43 lea (%rbx,%rax,2),%rdi > > > 1f: 48 39 ef cmp %rbp,%rdi > > > 22: 75 3d jne 0x61 > > > 24: 48 ff 05 ba 8c 91 02 incq 0x2918cba(%rip) # 0x2918ce5 > > > 2b:* 8b 6d 00 mov 0x0(%rbp),%ebp <-- trapping instruction > > > 2e: 66 85 ed test %bp,%bp > > > 31: 7e 09 jle 0x3c > > > 33: 48 ff 05 b3 8c 91 02 incq 0x2918cb3(%rip) # 0x2918ced > > > 3a: eb 05 jmp 0x41 > > > 3c: bd .byte 0xbd > > > 3d: 01 00 add %eax,(%rax) > > > > > > The slob_free() code tried to read four bytes at ffff88001c4afffe, and > > > ended up reading past the page into a bad area. I think the bad address > > > (ffff88001c4afffe) was returned from slob_next() and it panicked trying > > > to read s->units in slob_units(). > > Hello, > > It looks like a compiler bug. The code of slob_units() try to read two > bytes at ffff88001c4afffe. It's valid. But the compiler generates > wrong code that try to read four bytes. > > static slobidx_t slob_units(slob_t *s) > { > if (s->units > 0) > return s->units; > return 1; > } > > s->units is defined as two bytes in this setup. > > Wrongly generated code for this part. > > 'mov 0x0(%rbp), %ebp' > > %ebp is four bytes. > > I guess that this wrong four bytes read cross over the valid memory > boundary and this issue happend. > > Proper code (two bytes read) is generated if different version of gcc > is used. Which version fails to generate proper code and which versions work? Thanks, tglx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f200.google.com (mail-qt0-f200.google.com [209.85.216.200]) by kanga.kvack.org (Postfix) with ESMTP id 9A9C66B0038 for ; Tue, 17 Oct 2017 03:50:49 -0400 (EDT) Received: by mail-qt0-f200.google.com with SMTP id 31so1037721qtz.20 for ; Tue, 17 Oct 2017 00:50:49 -0700 (PDT) Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id u83si551276wmu.6.2017.10.17.00.50.48 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 17 Oct 2017 00:50:48 -0700 (PDT) Date: Tue, 17 Oct 2017 09:50:04 +0200 (CEST) From: Thomas Gleixner Subject: Re: [lkp-robot] [x86/kconfig] 81d3871900: BUG:unable_to_handle_kernel In-Reply-To: <20171017073326.GA23865@js1304-P5Q-DELUXE> Message-ID: References: <20171010121513.GC5445@yexl-desktop> <20171011023106.izaulhwjcoam55jt@treble> <20171011170120.7flnk6r77dords7a@treble> <20171017073326.GA23865@js1304-P5Q-DELUXE> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim Cc: Josh Poimboeuf , kernel test robot , Ingo Molnar , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Jiri Slaby , Linus Torvalds , Mike Galbraith , Peter Zijlstra , LKML , lkp@01.org, linux-mm@kvack.org, Pekka Enberg , David Rientjes , Andrew Morton , Christoph Lameter On Tue, 17 Oct 2017, Joonsoo Kim wrote: > On Wed, Oct 11, 2017 at 12:01:20PM -0500, Josh Poimboeuf wrote: > > > Looking at the panic, the code in slob_free() was: > > > > > > 0: e8 8d f7 ff ff callq 0xfffffffffffff792 > > > 5: 48 ff 05 c9 8c 91 02 incq 0x2918cc9(%rip) # 0x2918cd5 > > > c: 85 c0 test %eax,%eax > > > e: 75 51 jne 0x61 > > > 10: 49 0f bf c5 movswq %r13w,%rax > > > 14: 48 ff 05 c2 8c 91 02 incq 0x2918cc2(%rip) # 0x2918cdd > > > 1b: 48 8d 3c 43 lea (%rbx,%rax,2),%rdi > > > 1f: 48 39 ef cmp %rbp,%rdi > > > 22: 75 3d jne 0x61 > > > 24: 48 ff 05 ba 8c 91 02 incq 0x2918cba(%rip) # 0x2918ce5 > > > 2b:* 8b 6d 00 mov 0x0(%rbp),%ebp <-- trapping instruction > > > 2e: 66 85 ed test %bp,%bp > > > 31: 7e 09 jle 0x3c > > > 33: 48 ff 05 b3 8c 91 02 incq 0x2918cb3(%rip) # 0x2918ced > > > 3a: eb 05 jmp 0x41 > > > 3c: bd .byte 0xbd > > > 3d: 01 00 add %eax,(%rax) > > > > > > The slob_free() code tried to read four bytes at ffff88001c4afffe, and > > > ended up reading past the page into a bad area. I think the bad address > > > (ffff88001c4afffe) was returned from slob_next() and it panicked trying > > > to read s->units in slob_units(). > > Hello, > > It looks like a compiler bug. The code of slob_units() try to read two > bytes at ffff88001c4afffe. It's valid. But the compiler generates > wrong code that try to read four bytes. > > static slobidx_t slob_units(slob_t *s) > { > if (s->units > 0) > return s->units; > return 1; > } > > s->units is defined as two bytes in this setup. > > Wrongly generated code for this part. > > 'mov 0x0(%rbp), %ebp' > > %ebp is four bytes. > > I guess that this wrong four bytes read cross over the valid memory > boundary and this issue happend. > > Proper code (two bytes read) is generated if different version of gcc > is used. Which version fails to generate proper code and which versions work? Thanks, tglx -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5921789892215119289==" MIME-Version: 1.0 From: Thomas Gleixner To: lkp@lists.01.org Subject: Re: [lkp-robot] [x86/kconfig] 81d3871900: BUG:unable_to_handle_kernel Date: Tue, 17 Oct 2017 09:50:04 +0200 Message-ID: In-Reply-To: <20171017073326.GA23865@js1304-P5Q-DELUXE> List-Id: --===============5921789892215119289== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, 17 Oct 2017, Joonsoo Kim wrote: > On Wed, Oct 11, 2017 at 12:01:20PM -0500, Josh Poimboeuf wrote: > > > Looking at the panic, the code in slob_free() was: > > > = > > > 0: e8 8d f7 ff ff callq 0xfffffffffffff792 > > > 5: 48 ff 05 c9 8c 91 02 incq 0x2918cc9(%rip) # 0x2918cd5 > > > c: 85 c0 test %eax,%eax > > > e: 75 51 jne 0x61 > > > 10: 49 0f bf c5 movswq %r13w,%rax > > > 14: 48 ff 05 c2 8c 91 02 incq 0x2918cc2(%rip) # 0x2918cdd > > > 1b: 48 8d 3c 43 lea (%rbx,%rax,2),%rdi > > > 1f: 48 39 ef cmp %rbp,%rdi > > > 22: 75 3d jne 0x61 > > > 24: 48 ff 05 ba 8c 91 02 incq 0x2918cba(%rip) # 0x2918ce5 > > > 2b:* 8b 6d 00 mov 0x0(%rbp),%ebp <-- trapping inst= ruction > > > 2e: 66 85 ed test %bp,%bp > > > 31: 7e 09 jle 0x3c > > > 33: 48 ff 05 b3 8c 91 02 incq 0x2918cb3(%rip) # 0x2918ced > > > 3a: eb 05 jmp 0x41 > > > 3c: bd .byte 0xbd > > > 3d: 01 00 add %eax,(%rax) > > > = > > > The slob_free() code tried to read four bytes at ffff88001c4afffe, and > > > ended up reading past the page into a bad area. I think the bad addr= ess > > > (ffff88001c4afffe) was returned from slob_next() and it panicked tryi= ng > > > to read s->units in slob_units(). > = > Hello, > = > It looks like a compiler bug. The code of slob_units() try to read two > bytes at ffff88001c4afffe. It's valid. But the compiler generates > wrong code that try to read four bytes. > = > static slobidx_t slob_units(slob_t *s) = > { > if (s->units > 0) > return s->units; > return 1; > } > = > s->units is defined as two bytes in this setup. > = > Wrongly generated code for this part. > = > 'mov 0x0(%rbp), %ebp' > = > %ebp is four bytes. > = > I guess that this wrong four bytes read cross over the valid memory > boundary and this issue happend. > = > Proper code (two bytes read) is generated if different version of gcc > is used. Which version fails to generate proper code and which versions work? Thanks, tglx --===============5921789892215119289==--