Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935443AbeAKSg6 (ORCPT + 1 other); Thu, 11 Jan 2018 13:36:58 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:44238 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932215AbeAKSg4 (ORCPT ); Thu, 11 Jan 2018 13:36:56 -0500 X-Google-Smtp-Source: ACJfBosOWtBQmyyBgkKgt+ztSlzQM2xIqBOrMXDNmV8fSg/1CFVH5wg3XJBh+GIgYu+9kiE2mQLCgRWTs31naCj7+CE= MIME-Version: 1.0 In-Reply-To: References: <20180105175229.GA29834@kroah.com> <20180105204557.GA8839@kroah.com> <20180107104540.GB14783@kroah.com> <20180108074645.GA24062@kroah.com> From: Pavel Tatashin Date: Thu, 11 Jan 2018 13:36:50 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4.4 00/37] 4.4.110-stable review To: Greg Kroah-Hartman Cc: Andy Lutomirski , Hugh Dickins , Linus Torvalds , Thomas Voegtle , Linux Kernel Mailing List , Andrew Morton , Guenter Roeck , Shuah Khan , patches@kernelci.org, Ben Hutchings , lkft-triage@lists.linaro.org, stable , Steve Sistare Content-Type: multipart/mixed; boundary="001a11c17f8e7a24710562846e90" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8771 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801110254 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: --001a11c17f8e7a24710562846e90 Content-Type: text/plain; charset="UTF-8" I have root caused the memory corruption panics/hangs that I've been experiencing during boot with the latest 4.4.110 kernel. The problem as was suspected by Andy Lutomirski is with interaction between PTI and EFI. It may affect any system that has EFI bios. I have not verified if it can affect any other kernel beside 4.4.110 Attached is the fix for this issue with explanations that Steve Sistare and I developed. --001a11c17f8e7a24710562846e90 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-x86-pti-efi-broken-conversion-from-efi-to-kernel-pag.patch" Content-Disposition: attachment; filename="0001-x86-pti-efi-broken-conversion-from-efi-to-kernel-pag.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jcau3ni70 RnJvbSAxMTg5ZjM1NjhhOTBkZGQ0MGUxNDE4Yjk2ODdkZWY1ZDg5MTUzZWUzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXZlbCBUYXRhc2hpbiA8cGFzaGEudGF0YXNoaW5Ab3JhY2xl LmNvbT4KRGF0ZTogVGh1LCAxMSBKYW4gMjAxOCAwNjo1MDoyNSAtMDgwMApTdWJqZWN0OiBbUEFU Q0hdIHg4Ni9wdGkvZWZpOiBicm9rZW4gY29udmVyc2lvbiBmcm9tIGVmaSB0byBrZXJuZWwgcGFn ZSB0YWJsZQoKSW4gZW50cnlfNjQuUyB3ZSBoYXZlIGNvZGUgbGlrZSB0aGlzOgoKICAgIC8qIFVu Y29uZGl0aW9uYWxseSB1c2Uga2VybmVsIENSMyBmb3IgZG9fbm1pKCkgKi8KICAgIC8qICVyYXgg aXMgc2F2ZWQgYWJvdmUsIHNvIE9LIHRvIGNsb2JiZXIgaGVyZSAqLwogICAgQUxURVJOQVRJVkUg ImptcCAyZiIsICJtb3ZxICVjcjMsICVyYXgiLCBYODZfRkVBVFVSRV9LQUlTRVIKICAgIC8qIElm IFBDSUQgZW5hYmxlZCwgTk9GTFVTSCBub3cgYW5kIE5PRkxVU0ggb24gcmV0dXJuICovCiAgICBB TFRFUk5BVElWRSAiIiwgImJ0cyAkNjMsICVyYXgiLCBYODZfRkVBVFVSRV9QQ0lECiAgICBwdXNo cSAgICVyYXgKICAgIC8qIG1hc2sgb2ZmICJ1c2VyIiBiaXQgb2YgcGdkIG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