Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp73599imu; Fri, 14 Dec 2018 14:43:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHq25doW147TpTSpiXYKnWybEcm/4K3flSwd2FIE3XRueb3jpS+zCR5uvCF5YTkqgFBhZA X-Received: by 2002:a62:2702:: with SMTP id n2mr4652865pfn.29.1544827433743; Fri, 14 Dec 2018 14:43:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544827433; cv=none; d=google.com; s=arc-20160816; b=dFRmoS2y/jHh4P3fVDHahW2VqfwfHJlT9TD9uMAQUav0RTKso3edbagCRUDfKrf7gm DsHIs+mRJpVBFnJshIS7QqqqZ0wgtAdwodFhaQJQ5WhTyw6++/jqyUUKilpMQvTH3XRw DvXi5oUUcDIXgNeQUpWITzH5mC0LyJFoNTnUDAGrCfhflcToyvGt1mLik/1Yg3OrbZNl TPke5RqfkVUrqXb9m89VyYWgn/J5/7xUNAEXtmEOYybptujGs32UwYVwPYt/M6lBfWCH ni3LOxXIqomL10vt5TLsduo1qFWiw/aNbwIMflCDHFz0G/sg5jv6zVlVMsN2mxUxrCR7 7Ujw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=D8ZMRmXR3lIzkJOLCZOTd8puXsQfKv4tqzA9tk7cVKI=; b=0qJFRbnbF5VnSocs5lsB3VT8Ch9+bqeXWKStSgAdaSjefMqpF+AA2+5U2I3a00mIQy XyvB9x3Hlwc1l0Xn+JXgEoAisv5iD0ocO+JBMV2SvtW63dtldUBKv2lft99VC4ok81EV Kau6qclMKOaxroNx77jGGYLBBqhYhjuVZPATCMhcHE84G4NOG9AqF84jEXAO2AgM3+fm 01BY1BpT8smB21rDahjs3BXumdXwVpkNdxEvCCDwe65bs1zcgbzRYheQR3Jc9XNUY389 4r9o3y3Usyq51HVTt2WEURseKrYWUJdD3paKpKvZ6gjRN2mlcrjABF0bbiwHmQUdflf4 2t4g== 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 e4si4956141pgk.127.2018.12.14.14.43.36; Fri, 14 Dec 2018 14:43:53 -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 S1730290AbeLNWmY (ORCPT + 99 others); Fri, 14 Dec 2018 17:42:24 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]:29888 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729752AbeLNWmX (ORCPT ); Fri, 14 Dec 2018 17:42:23 -0500 X-RZG-AUTH: ":OH8QVVOrc/CP6za/qRmbF3BWedPGA1vjs2e0bDjfg8OiOrPJifeRMRhMbfKobJAvSmsJbFO0KIY=" X-RZG-CLASS-ID: mo00 Received: from [192.168.2.24] by smtp.strato.de (RZmta 44.8 DYNA|AUTH) with ESMTPSA id V03c59uBEMg16wE (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 14 Dec 2018 23:42:01 +0100 (CET) Subject: Re: [PATCH] acpi / apei: fix NULL deref during init To: Thomas Schoebel-Theuer , Borislav Petkov Cc: linux-kernel@vger.kernel.org, Laura Abbott , "Rafael J. Wysocki" , Len Brown , Tony Luck , linux-acpi@vger.kernel.org References: <20181214181514.29891-1-tst@schoebel-theuer.de> <20181214202406.GI11710@zn.tnic> From: =?UTF-8?Q?Thomas_Sch=c3=b6bel-Theuer?= Message-ID: <5ec69dad-7943-343b-5ced-9a962652e14c@schoebel-theuer.de> Date: Fri, 14 Dec 2018 23:42:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/14/18 22:27, Thomas Schoebel-Theuer wrote: > On 12/14/18 21:24, Borislav Petkov wrote: >> >> Because apei_resources_fini() happens under the same condition check and >> if arch_apei_filter_addr was false, it should not become true, all of a >> sudden. Or? > > please take a look at the stacktrace. For some reason, and only at > that specific hardware, the condition is false, there but later the > indicated error exit is taken whose message you can see immediately > before the stack trace. > Ah, I overlooked that commit e56c92565dfe2 is already providing a different solution to the same problem in newer kernels _only_, as a _side_ effect (not clear to me from the description, but clear from reading the code). But this patch is not present at the 4.4.166 kernel where I found the problem and fixed it internally in a different way. The 4.4.166 code looks like this, without the if-statement you are mentioning, unconditionally trying to free the unitinialized variable under certain circumstances: d91525eb8ee6a (Chen, Gong     2014-12-10 13:53:26 -0800 553) arch_res_fini: d91525eb8ee6a (Chen, Gong     2014-12-10 13:53:26 -0800 554) apei_resources_fini(&arch_res); d91525eb8ee6a (Chen, Gong     2014-12-10 13:53:26 -0800 555) nvs_res_fini: 4134b8c8811f2 (Huang Ying     2011-12-08 11:25:50 +0800 556) apei_resources_fini(&nvs_resources); 23f124ca3dda9 (Huang Ying     2010-09-29 19:53:54 +0800 557) return rc; So another alternative would be backporting e56c92565dfe2 to the 4.4 LTS series. Also fine for me.