Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5988411ybe; Tue, 10 Sep 2019 11:48:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyx0mM9chcCeXBi2U0lxlAJgDsE32P4ReR4HC7l4d+4CzyqxNBjNTH6w3yuVzQbqI6a3i/H X-Received: by 2002:a17:906:80cd:: with SMTP id a13mr26718822ejx.155.1568141294242; Tue, 10 Sep 2019 11:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141294; cv=none; d=google.com; s=arc-20160816; b=GphkyKEPvZPREpawtI9vGzuAnaoNwOtQl6/jchMOuFvHJt02FdcF2DdeC/5f9SH6Hv rBO9YgoUy7MnYJzHRMlc8RVfQ/vtdDzMSCe6sw+GOIOnsOYF/llp77tA8Tz97zAGD58O cP4uJc3QLbB2ScFwBJT/wdbnR8vge1Yu9boa2CPUnIOaampoFauYxGz1ZafsYMl7SxjI nhukyEnSlVsx7b+ew19eK1H+/KyBHxxa/OBKlgXTnOpRhGPk05W+d3EpyShNlzzu3cMJ wab9sWjrVgrX8zTXMmKknc3/kz63KyRgpcZXQzffy/CA6dIp2/8dD+kNIHjomb6uOp3W wMJQ== 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=GaMj7lQehLTfaPn2X5bBjfSMMlelElzGs5aGIZacoRM=; b=dwv/KAAYIwye6icMm9tqh6IHv4b+rk+ITKgUG4t8Sf8lYkjO6o8n/GAyBipR5sn7L8 DVRlqxHSI2tirUe4jBtZ8u13aopdO8eqqEcWYgE19+3HGyNORzbQva9nAF+HSdOQs44R vKPzkls7Rf9Jmb2L8CBHWzMkCW9X2/Ct2DZ8tzBem4r/U7GCc7TFwENag53FgO1jyWjI JVO17HJKAnJU2WCtjogbYiiGwDpSt+HN6rkQPIboBwZXjtbU/XTywuri2RhhJQHjstu2 hRur+Ua0PAKtr8uhGN+0DpdR7JH9Y0m3hOccB41ds3gTDEhxXocv6a/VEdS8nW+qKckb 0Eeg== 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 g13si9971505ejw.269.2019.09.10.11.47.50; Tue, 10 Sep 2019 11:48:14 -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 S2393162AbfIJFfN (ORCPT + 99 others); Tue, 10 Sep 2019 01:35:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2259 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390795AbfIJFfM (ORCPT ); Tue, 10 Sep 2019 01:35:12 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D4E906A0A81874DC646C; Tue, 10 Sep 2019 13:35:09 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 10 Sep 2019 13:35:01 +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: Date: Tue, 10 Sep 2019 13:34:59 +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 Hi Scott, 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. > How did you change the load address of the uImage, by changing the kernel config CONFIG_PHYSICAL_START or the "-a/-e" parameter of mkimage? I tried both, but it did not work with or without CONFIG_RANDOMIZE. Thanks, Jason >> 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 > > > > . >