Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbcLESLx (ORCPT ); Mon, 5 Dec 2016 13:11:53 -0500 Received: from mail.kernel.org ([198.145.29.136]:60612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbcLESLt (ORCPT ); Mon, 5 Dec 2016 13:11:49 -0500 MIME-Version: 1.0 In-Reply-To: References: <2bdc068d-afd5-7a78-f334-26970c91aaca@fb.com> <203e0319-bc9b-245c-e162-709267540d22@fb.com> <20161026233808.GC15247@clm-mbp.thefacebook.com> <20161026234751.e66xyzjiwifvbuha@codemonkey.org.uk> <20161031185514.b22zvbxvga4xcinz@codemonkey.org.uk> <20161031194454.GA49877@clm-mbp.thefacebook.com> <20161123193419.pq7adje2eanky2wx@codemonkey.org.uk> <20161123195845.iphzr7ac4mu5ewjt@codemonkey.org.uk> From: Andy Lutomirski Date: Mon, 5 Dec 2016 10:11:23 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: bio linked list corruption. To: Vegard Nossum , Borislav Petkov Cc: Dave Jones , Chris Mason , Linus Torvalds , Jens Axboe , Andy Lutomirski , Al Viro , Josef Bacik , David Sterba , linux-btrfs , Linux Kernel , Dave Chinner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2173 Lines: 60 On Sun, Dec 4, 2016 at 3:04 PM, Vegard Nossum wrote: > On 23 November 2016 at 20:58, Dave Jones wrote: >> On Wed, Nov 23, 2016 at 02:34:19PM -0500, Dave Jones wrote: >> >> > [ 317.689216] BUG: Bad page state in process kworker/u8:8 pfn:4d8fd4 >> > trace from just before this happened. Does this shed any light ? >> > >> > https://codemonkey.org.uk/junk/trace.txt >> >> crap, I just noticed the timestamps in the trace come from quite a bit >> later. I'll tweak the code to do the taint checking/ftrace stop after >> every syscall, that should narrow the window some more. > > FWIW I hit this as well: > > BUG: unable to handle kernel paging request at ffffffff81ff08b7 We really ought to improve this message. If nothing else, it should say whether it was a read, a write, or an instruction fetch. > IP: [] __lock_acquire.isra.32+0xda/0x1a30 > PGD 461e067 PUD 461f063 > PMD 1e001e1 Too lazy to manually decode this right now, but I don't think it matters. > Oops: 0003 [#1] PREEMPT SMP KASAN Note this is SMP, but that just means CONFIG_SMP=y. Vegard, how many CPUs does your kernel think you have? > RIP: 0010:[] [] > __lock_acquire.isra.32+0xda/0x1a30 > RSP: 0018:ffff8801bab8f730 EFLAGS: 00010082 > RAX: ffffffff81ff071f RBX: 0000000000000000 RCX: 0000000000000000 RAX points to kernel text. > Code: 89 4d b8 44 89 45 c0 89 4d c8 4c 89 55 d0 e8 ee c3 ff ff 48 85 > c0 4c 8b 55 d0 8b 4d c8 44 8b 45 c0 4c 8b 4d b8 0f 84 c6 01 00 00 <3e> > ff 80 98 01 00 00 49 8d be 48 07 00 00 48 ba 00 00 00 00 00 2b: 3e ff 80 98 01 00 00 incl %ds:*0x198(%rax) <-- trapping instruction That's very strange. I think this is: atomic_inc((atomic_t *)&class->ops); but my kernel contains: 3cb4: f0 ff 80 98 01 00 00 lock incl 0x198(%rax) So your kernel has been smp-alternatived. That 3e comes from alternatives_smp_unlock. If you're running on SMP with UP alternatives, things will break. What's your kernel command line? Can we have your entire kernel log from boot? Adding Borislav, since he's the guru for this code.