Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5439175ybh; Wed, 7 Aug 2019 06:06:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqylgebWkQtlZCmfBB4ZsHMmggnT6UocmalnhpsDsCkzzj9gj3nvRacKBtOSaXxVXHrky9FP X-Received: by 2002:a63:3387:: with SMTP id z129mr7579322pgz.177.1565183167836; Wed, 07 Aug 2019 06:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565183167; cv=none; d=google.com; s=arc-20160816; b=hlSZkIuvLCxx0E+QYuYwqaZhDuxmJmwFVA7hXJwQz+Jh6x7kz7jpLxr3eiXTlTv3Gu JqPAEz2mLMCo/si3JRkS2FopqKS+pPIw39MwEWLDoZ1lH27m9CtyGm6uVRbVB+xRPbYg SucO2BIteaYX9jhHJoN13/PiGC81kxtjznCiYlsQL7hNDh6rgJ/mu1ziHq2UGZHstiNm 8kSPWdtLwI9/dVMN4IfSxLVxCU/hHClJCFU52wDdAHyrCOHoZd7nvC3Fw2KQI2t9g8H1 WXQNOe4Dhz5/yPTOJ+5cGxOB5eqVL3M5XX1spXXeAVrh/CrrKiYYDWNocWazTVoYdi5b DWMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=7d/AKzgsNCOzoVfSecJ3Yb550/ZCocaixgIKis/Jp+0=; b=ykKz+9aWz7M64xKyfkfc15oJL7k7LapCF7b4k7qqHTC6oJlMkZfrx3nUINfDbFATsJ 9hNkdp4fCwEVffG7BWxxETyPrBb+gapFLlJYWaoSyhjIP7PbwrQT4bOYoYi79/us03YA KV/3dgGV9tvmWDS+Qo3RDCjiqu2A0z68FrP+cbUM1YeQYjJemIMV+6eGUevf+R0Whhf3 N2Da8yRu2uHYxfem2pRVs6x32oEwNkGrCxMQ9D1uFGlhVswFDBbTDTMIAqw+RPCwo6CN ZHHZvc4Zt0p+hC1NesbtKlVeEVnIR5is7bGsY8vBYSqaOJ5LTx9AKl5aUIPvVN+OlOgJ lwzg== 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 189si11716414pfe.189.2019.08.07.06.05.50; Wed, 07 Aug 2019 06:06:07 -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 S2388108AbfHGNED (ORCPT + 99 others); Wed, 7 Aug 2019 09:04:03 -0400 Received: from ozlabs.org ([203.11.71.1]:33391 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387476AbfHGNEC (ORCPT ); Wed, 7 Aug 2019 09:04:02 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 463Wsr3SMxz9sNx; Wed, 7 Aug 2019 23:04:00 +1000 (AEST) From: Michael Ellerman To: Jason Yan , 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: linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, yebin10@huawei.com, thunder.leizhen@huawei.com, jingxiangfeng@huawei.com, fanchengyang@huawei.com, zhaohongjiang@huawei.com, Jason Yan Subject: Re: [PATCH v5 09/10] powerpc/fsl_booke/kaslr: support nokaslr cmdline parameter In-Reply-To: <20190807065706.11411-10-yanaijie@huawei.com> References: <20190807065706.11411-1-yanaijie@huawei.com> <20190807065706.11411-10-yanaijie@huawei.com> Date: Wed, 07 Aug 2019 23:03:56 +1000 Message-ID: <87y305t9dv.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jason Yan writes: > diff --git a/arch/powerpc/kernel/kaslr_booke.c b/arch/powerpc/kernel/kaslr_booke.c > index c6b326424b54..436f9a03f385 100644 > --- a/arch/powerpc/kernel/kaslr_booke.c > +++ b/arch/powerpc/kernel/kaslr_booke.c > @@ -361,6 +361,18 @@ static unsigned long __init kaslr_choose_location(void *dt_ptr, phys_addr_t size > return kaslr_offset; > } > > +static inline __init bool kaslr_disabled(void) > +{ > + char *str; > + > + str = strstr(boot_command_line, "nokaslr"); > + if (str == boot_command_line || > + (str > boot_command_line && *(str - 1) == ' ')) > + return true; This extra logic doesn't work for "nokaslrfoo". Is it worth it? cheers