Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1656269ybl; Wed, 28 Aug 2019 18:59:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpHISc6rDiSocoN0keghrzq74mWd1wBFAKTq8fA4btagz1r2juTbGXVhPH+IU9CmtQBZl3 X-Received: by 2002:a63:2264:: with SMTP id t36mr5808874pgm.87.1567043994627; Wed, 28 Aug 2019 18:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567043994; cv=none; d=google.com; s=arc-20160816; b=u7mTwywueSuZR34ku7LLyOvYcu1QIY7AaNmGl4kgPoeqDDVAa7NiRsGnJV6rUZt5bK gzXZAkJxTlze8BUOdKMlQrvL5w4HtZg5X60pG89tjdAfUdQHPQjJUjoBVt0mVoDpJHbz 9bxxnR696PgqPYvr4xf1fdy1yVOOftVeT7n/42A7IpmPeq8+dsr6XhFXP7m40ezW+DfK 9GAwJAIXrSyo3Fsm8yoBI7EDyCeeBiaPMAvCsKg8FIAMY9OnrQ0q0d7PXpISWVfuwTW6 N6XZlt076MouOExie8Xnzc4Pu11y4/Ngi7fCpz5QSIaRbPNJqh7iq8I6YAuUWQlJJiq+ nTAg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=V9bD8J14tjojuzAkwRy39CXgZfIdcIfHyXPiuODkZ+0=; b=a3gB3g3yfca6InEzvgZOIFx9sgFTMRWRy/BIdxqb4B/+Ca7G/f9KDXngsPrlgcW62F dOrsxcDI88s0p6y4EuJNUFSizhh4+E9DrxRihYZHIP8yCLM+cSJDuw6lWYFrvSWvnRcN 9Ee6ohX9faYHcD1gOQXqdNTFoZvxwkvE79rP05NEZg2w+APqULsV1qe3ogJtYUtqB/Hc UHS9nunMGsYSIIwrInGkvb05itmNNE3f+e9IcP/tCAnNi+ZIuqhT0N8iMEuFj48qC01V utm5QHwE6waX6ZNX369kcG/S9abtFTc8azlby5vRaJmhh9zBnzZ0d4iKyjq+Hdv54j6C XXOg== 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 t185si643152pgb.329.2019.08.28.18.59.37; Wed, 28 Aug 2019 18:59:54 -0700 (PDT) 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 S1726369AbfH2B5d (ORCPT + 99 others); Wed, 28 Aug 2019 21:57:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5687 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725993AbfH2B5c (ORCPT ); Wed, 28 Aug 2019 21:57:32 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4F550E427B9ACF4E9F9F; Thu, 29 Aug 2019 09:57:31 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Thu, 29 Aug 2019 09:57:22 +0800 Subject: Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32 To: Scott Wood , , , , , , , , , CC: , , , , , , References: <20190809100800.5426-1-yanaijie@huawei.com> From: Jason Yan Message-ID: <923983fc-364d-440d-5c3a-3d3d6de60d14@huawei.com> Date: Thu, 29 Aug 2019 09:57:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.203] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/8/28 12:05, Scott Wood wrote: > On Fri, 2019-08-09 at 18:07 +0800, Jason Yan wrote: >> This series implements KASLR for powerpc/fsl_booke/32, as a security >> feature that deters exploit attempts relying on knowledge of the location >> of kernel internals. >> >> Since CONFIG_RELOCATABLE has already supported, what we need to do is >> map or copy kernel to a proper place and relocate. > > Have you tested this with a kernel that was loaded at a non-zero address? I > tried loading a kernel at 0x04000000 (by changing the address in the uImage, > and setting bootm_low to 04000000 in U-Boot), and it works without > CONFIG_RANDOMIZE and fails with. > Not yet. I will test this kind of cases in the next days. Thank you so much. If there are any other corner cases that have to be tested, please let me know. >> Freescale Book-E >> parts expect lowmem to be mapped by fixed TLB entries(TLB1). The TLB1 >> entries are not suitable to map the kernel directly in a randomized >> region, so we chose to copy the kernel to a proper place and restart to >> relocate. >> >> Entropy is derived from the banner and timer base, which will change every >> build and boot. This not so much safe so additionally the bootloader may >> pass entropy via the /chosen/kaslr-seed node in device tree. > > How complicated would it be to directly access the HW RNG (if present) that > early in the boot? It'd be nice if a U-Boot update weren't required (and > particularly concerning that KASLR would appear to work without a U-Boot > update, but without decent entropy). > > -Scott > > > > . >