Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3360191imj; Tue, 19 Feb 2019 02:02:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IaL9TbF9hlLSViLEarTKH8KM3ZD3BWJcabtxPnE4aPhbUTeE/IGZYK9iiJ9VCK9lMXQjBDq X-Received: by 2002:a62:6d81:: with SMTP id i123mr15720390pfc.235.1550570576381; Tue, 19 Feb 2019 02:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550570576; cv=none; d=google.com; s=arc-20160816; b=XqpblscgsgF/N1/va19iOJBECotE05cvub7XqC5TVNGTEilnpIFzoaw1CBgkmBovhm Y3Y7HrjR3ASd4k2OkxxStADpSnEexWRv2scyFHthLyk11Ht06XOVvF4OJ+bVCdv/OY/z iMPt9MnLtGq1Z5JE10WurteORbZPLIAp4OKC7RuswfLSqd2sQWjW1QtvBh2QVX3iAhoe jJSfscPJUbsBAkcluY7ENgaypFvxXHeUdLVzM0hiwJN4S4/yMzXbVWAe6wOh22MCj7Ty 9QCOkjaXV+xwZm8MGA6VxCFK6m6xAoHaFgPLNVv8Sz4mUcCYlZ87nnPmDnyc+5cbyy8P rtnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+xP/yUvlB27tANdCTb8SJZ/IHNos8XRLQAwFjDWAFDw=; b=bTyRU9hon9424sqMLdVLR17J7NW4RJU3Wi1hKRlWQNE7YcQBbvll8pTLtyUsLPndn3 AAmwAiU6DvbIkzwBmIb60eAj0wBukIB/UsI1AV0JeDvq0TtokdMgESD4ke8OiXQ6HgrT 4KE+RgLb6rQalsbt6s9Vho19eFsTGPW5Z56h1ajUUIulfM0r26+4Kdjs7h1/fvSO6mtT x3V4mgw5tc5z3IIXmzmS0QY56FYlGhwpEE1m4DOFGVPAWraK4sBG6Am8jLH7p4uNfgF1 qtvoSHOBeZYckIJ5YWEtK6WBrCwVIXRc8LORuCna53u+yVazZ59x66m4QT1u/Yiky17x DCxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ct15si2402006plb.333.2019.02.19.02.02.41; Tue, 19 Feb 2019 02:02:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728160AbfBSKCR (ORCPT + 99 others); Tue, 19 Feb 2019 05:02:17 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:42230 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfBSKCQ (ORCPT ); Tue, 19 Feb 2019 05:02:16 -0500 Received: from 79.184.254.15.ipv4.supernova.orange.pl (79.184.254.15) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.183) id 78b9c2310d98f25a; Tue, 19 Feb 2019 11:02:14 +0100 From: "Rafael J. Wysocki" To: Ross Lagerwall , Borislav Petkov Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, Len Brown , Tony Luck , Huang Ying Subject: Re: [PATCH v2 0/2] Fix crash in cper_estatus_check() Date: Tue, 19 Feb 2019 11:00:49 +0100 Message-ID: <2534482.fmfRlZkPUo@aspire.rjw.lan> In-Reply-To: <20190128100424.30278-1-ross.lagerwall@citrix.com> References: <20190128100424.30278-1-ross.lagerwall@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, January 28, 2019 11:04:22 AM CET Ross Lagerwall wrote: > v2 changes: > - Address Boris's comments. > > --- > > I recently encountered a crash in cper_estatus_check() when called by > bert_init(). Patches follow to fix the problem. Note that I cannot fully > test the patches since the hardware error record on that machine has > been cleared. > > The crash log: > > [ 125.666350] BUG: unable to handle kernel paging request at ffffc9004046d02c > [ 125.666503] PGD 1f6dce067 P4D 1f6dce067 PUD 1e6532067 PMD 1e3d11067 PTE 0 > [ 125.666696] Oops: 0000 [#1] SMP KASAN NOPTI > [ 125.666837] CPU: 7 PID: 1 Comm: swapper/0 Not tainted 4.19.0+0 #1 > [ 125.666983] Hardware name: Dell Inc. PowerEdge M520/0DW6GX, BIOS 1.8.6 08/30/2013 > [ 125.667171] RIP: e030:cper_estatus_check+0x7e/0xf0 > [ 125.667315] Code: 41 29 c5 48 98 48 01 c3 48 89 d8 4c 29 e0 48 39 e8 7d 4a 48 8d 7b 18 be 04 00 00 00 e8 bb 6f 9f ff 48 8d 7b 14 be 02 00 00 00 <44> 8b 73 18 e8 a9 6f 9f ff 0f b6 4b 15 44 89 ee 66 83 f9 03 19 d2 > [ 125.667554] RSP: e02b:ffff8881e65efce0 EFLAGS: 00010246 > [ 125.667699] RAX: fffff5200808da06 RBX: ffffc9004046d014 RCX: ffffffff8192bf25 > [ 125.667849] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffffc9004046d028 > [ 125.668009] RBP: 0000000000000700 R08: fffff5200808da06 R09: fffff5200808da06 > [ 125.668207] R10: 0000000000000001 R11: fffff5200808da05 R12: ffffc9004046cc14 > [ 125.668358] R13: 0000000000000300 R14: 00000000000000c0 R15: ffffc9004046cc00 > [ 125.668519] FS: 0000000000000000(0000) GS:ffff8881e77c0000(0000) knlGS:0000000000000000 > [ 125.668698] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 125.668844] CR2: ffffc9004046d02c CR3: 000000000260c000 CR4: 0000000000042660 > [ 125.668999] Call Trace: > [ 125.669139] bert_init+0x21c/0x362 > [ 125.669279] ? setup_bert_disable+0x12/0x12 > [ 125.669420] ? pci_get_dev_by_id+0x57/0x70 > [ 125.669560] ? pci_get_device+0x86/0xc0 > [ 125.669738] ? pci_create_sysfs_dev_files+0x1a6/0x330 > [ 125.669883] ? setup_bert_disable+0x12/0x12 > [ 125.670026] ? set_debug_rodata+0x11/0x11 > [ 125.670166] ? do_one_initcall+0x8b/0x253 > [ 125.670306] do_one_initcall+0x8b/0x253 > [ 125.670447] ? perf_trace_initcall_level+0x250/0x250 > [ 125.670592] ? __wake_up_common+0x140/0x1d0 > [ 125.670736] ? kasan_unpoison_shadow+0x30/0x40 > [ 125.670879] ? kasan_unpoison_shadow+0x30/0x40 > [ 125.671023] ? set_debug_rodata+0x11/0x11 > [ 125.671164] kernel_init_freeable+0x269/0x304 > [ 125.671346] ? rest_init+0xc0/0xc0 > [ 125.671485] kernel_init+0xf/0x130 > [ 125.671623] ? rest_init+0xc0/0xc0 > [ 125.671761] ? rest_init+0xc0/0xc0 > [ 125.671901] ret_from_fork+0x35/0x40 > [ 125.672063] Modules linked in: > [ 125.672201] CR2: ffffc9004046d02c > [ 125.672349] ---[ end trace a17cd87742b2c49e ]--- > [ 125.683693] RIP: e030:cper_estatus_check+0x7e/0xf0 > [ 125.683840] Code: 41 29 c5 48 98 48 01 c3 48 89 d8 4c 29 e0 48 39 e8 7d 4a 48 8d 7b 18 be 04 00 00 00 e8 bb 6f 9f ff 48 8d 7b 14 be 02 00 00 00 <44> 8b 73 18 e8 a9 6f 9f ff 0f b6 4b 15 44 89 ee 66 83 f9 03 19 d2 > [ 125.684103] RSP: e02b:ffff8881e65efce0 EFLAGS: 00010246 > [ 125.684247] RAX: fffff5200808da06 RBX: ffffc9004046d014 RCX: ffffffff8192bf25 > [ 125.684397] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffffc9004046d028 > [ 125.684548] RBP: 0000000000000700 R08: fffff5200808da06 R09: fffff5200808da06 > [ 125.684699] R10: 0000000000000001 R11: fffff5200808da05 R12: ffffc9004046cc14 > [ 125.684850] R13: 0000000000000300 R14: 00000000000000c0 R15: ffffc9004046cc00 > [ 125.685009] FS: 0000000000000000(0000) GS:ffff8881e77c0000(0000) knlGS:0000000000000000 > [ 125.685224] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 125.685371] CR2: ffffc9004046d02c CR3: 000000000260c000 CR4: 0000000000042660 > [ 125.685566] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 > > Thanks, > > Ross Lagerwall (2): > acpi/apei: Fix possible out-of-bounds access to BERT region > efi/cper: Fix possible out-of-bounds access > > drivers/acpi/apei/bert.c | 23 ++++++++++------------- > drivers/firmware/efi/cper.c | 13 +++++++++---- > 2 files changed, 19 insertions(+), 17 deletions(-) > > Boris, any comments here?