From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934548AbdCVM4g (ORCPT ); Wed, 22 Mar 2017 08:56:36 -0400 Received: from forward4h.cmail.yandex.net ([87.250.230.101]:34633 "EHLO forward4h.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934079AbdCVM40 (ORCPT ); Wed, 22 Mar 2017 08:56:26 -0400 X-Greylist: delayed 323 seconds by postgrey-1.27 at vger.kernel.org; Wed, 22 Mar 2017 08:56:26 EDT Authentication-Results: smtp2m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0 Subject: Re: 32-bit x86 system reboots automatically on resume from hibernate (ASLR issue?) To: Kees Cook References: <58D13084.7040800@yandex.ru> Cc: "H. Peter Anvin" , Thomas Gleixner , LKML From: Evgenii Shatokhin Message-ID: <58D27331.5050109@yandex.ru> Date: Wed, 22 Mar 2017 15:50:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.03.2017 23:40, Kees Cook wrote: > On Tue, Mar 21, 2017 at 6:54 AM, Evgenii Shatokhin > wrote: >> Hi, >> >> One of my x86 machines with a 32-bit Linux system (ROSA Linux in this case) >> automatically reboots when it tries to resume from hibernate. This happens >> shortly after "Image loading progress 100%" message is shown on the screen. >> >> No traces of the error are in the system log after reboot though. >> >> The problem is present at least in the mainline kernels 4.8 - 4.10. With >> earlier versions (I tried 4.4, 4.5, etc.), the system resumes OK. >> >> The bisection pointed to the following commit as the first "bad" one: >> >> commit 65fe935dd2387a4faf15314c73f5e6d31ef0217e >> Author: Kees Cook >> Date: Mon Jun 13 15:10:02 2016 -0700 >> >> x86/KASLR, x86/power: Remove x86 hibernation restrictions > > Hrm, perhaps the 32-bit hibernation code still isn't KASLR-safe. If > you boot with nokaslr on the kernel command line, does the problem go > away? Yes. The problem does not show up when I boot the system with 'nokaslr'. > >> Hardware: https://linux-hardware.org/index.php?probe=e6a06c64c7 >> Config used to build the kernel at rev. 65fe935: >> http://pastebin.com/AxEA6ahb >> >> If I understand it correctly, this commit just enabled ASLR by default >> regardless of whether hibernation support was present or not. Before this >> commit, ASLR was disabled on that system because hibernation was supported. >> >> To check if ASLR is really involved here, I rebuilt the kernel with >> CONFIG_RANDOMIZE_BASE unset - now the system resumes OK from hibernation, no >> auto reboots, no other visible problems so far. >> >> The problem does not show up in a 64-bit Linux system installed on the same >> machine. Only the 32-bit system is affected. > > (Why would you want to run 32-bit kernels on a 64-bit system?) Mostly for testing and debugging. While most of ROSA Linux users are OK with the 64-bit version of the distro, some still need its 32-bit variant. They reported (unrelated) problems with hibernate. I was debugging these and stumbled upon this problem as well. Regards, Evgenii > > -Kees >