Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp319729ybl; Tue, 27 Aug 2019 21:13:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGmNMA4VekJwfC7l/hcvQsA1nTW/dgLIIqZRb32wpcK6DQIrL70LetKsDXh/X8eyEUyJxc X-Received: by 2002:aa7:9552:: with SMTP id w18mr2296494pfq.107.1566965611997; Tue, 27 Aug 2019 21:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566965611; cv=none; d=google.com; s=arc-20160816; b=QgBGKSAlfR3aYsryfX6hFCpjc1mEEuhN+aqRi2r2uRglWxzENKizUAReHjrGR/90Y4 SfdE0fcDDvQhLsAwu+12iRJOa47p6/Gh2od2MhRZ6NOg1fbPgerI350tmH7N5lykdCcR FOCa/l5zP7tKJvV7A3XpxsY2QcHe1ZOb/q9+F/EVWjRQYnpcnC1MF5vB563JPCTbBlYL Xmmyd+I5+scTZ8PQmTaohdmaP2lBN3nWAflqriVkbDrO8W8Fy3QDd2HzXqXSfzFFTdNP XtcZVg65cJdxiMZxoEtS/Sxut7KC00vv4S8irFyi1Q+afHG656BTZjolJXPOK1VpFoqX 13nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=Bsd2Mi2RXbIauWUQ/jnm5nvg7Jw13N8jnV0z5GBVEF0=; b=guuA4QfNSAz4MR/L8MNunV1UZIEkHDDguHnsnfaQbnrVeBSYglB4F0zFa7BlzBpf5P xejTIB4a6V/3F9koekOI88eN3SRy36Z57FhoLmnMBjEAXykVeNG4stM5slR5x6uE7WFB Xvq6PO3IzAdO+6RycJqsHotAohgPBMak5YN1AMhHkCFNu3xeQu7q1TAm3tB38Pejy0/m Z56pFvLITHKbQu+ZvEcj7xG4PHioOShXD+tXftbqPcfXXovY1swW5dB/1BXgImVJR5ZD s11kbFLXhbPTk0ki/JkJQuuINzXCdo1iGEVU+Rt4Obxv8eZWCpFnkOIQR+3gKOoxGNgU 2NzQ== 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 f23si932026plj.241.2019.08.27.21.13.15; Tue, 27 Aug 2019 21:13:31 -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 S1726114AbfH1EMX (ORCPT + 99 others); Wed, 28 Aug 2019 00:12:23 -0400 Received: from baldur.buserror.net ([165.227.176.147]:49074 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbfH1EMX (ORCPT ); Wed, 28 Aug 2019 00:12:23 -0400 Received: from [2601:449:8400:7293:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i2pDA-0007By-1u; Tue, 27 Aug 2019 23:05:32 -0500 Message-ID: From: Scott Wood To: Jason Yan , mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com Cc: wangkefeng.wang@huawei.com, linux-kernel@vger.kernel.org, jingxiangfeng@huawei.com, zhaohongjiang@huawei.com, thunder.leizhen@huawei.com, fanchengyang@huawei.com, yebin10@huawei.com Date: Tue, 27 Aug 2019 23:05:30 -0500 In-Reply-To: <20190809100800.5426-1-yanaijie@huawei.com> References: <20190809100800.5426-1-yanaijie@huawei.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2601:449:8400:7293:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: yanaijie@huawei.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com, wangkefeng.wang@huawei.com, linux-kernel@vger.kernel.org, jingxiangfeng@huawei.com, zhaohongjiang@huawei.com, thunder.leizhen@huawei.com, fanchengyang@huawei.com, yebin10@huawei.com X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on baldur.localdomain X-Spam-Level: X-Spam-Status: No, score=-17.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -1.5 GREYLIST_ISWHITE The incoming server has been whitelisted for * this recipient and sender Subject: Re: [PATCH v6 00/12] implement KASLR for powerpc/fsl_booke/32 X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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