Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp200626ybz; Thu, 23 Apr 2020 21:55:37 -0700 (PDT) X-Google-Smtp-Source: APiQypI+64QrbZxtw2fm1DLu+DT2IiIwC27bfgLGwk2ptc/4DEWGxLdtdLeuxsm2NypyJ5iF+ZjO X-Received: by 2002:aa7:d413:: with SMTP id z19mr5815110edq.80.1587704137798; Thu, 23 Apr 2020 21:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587704137; cv=none; d=google.com; s=arc-20160816; b=cyDsoL3AJ6nArU+zBFNgcgu3mnPSh9c3sArfxBPPFWviPW00utiNCV6qbvn131bmJB OeBe13v+1Fq0KgHqjd2NPYfhYsV1Su5OCKou2MT8txXTXzBgvulCVW3qXXAR308ck/kh +N0LNB8Qu84Hs4KPOqz3fykUsGe6vCGVhQsLx3PoifZOpk482SOOiak4K0fdsjFfM8xt ysgYopBUtPeuN+VtGkv1BMIPIshQnOUxtQOwERJOd/rEWoEjlkwYjj5vK38iyKmdTvB/ xqUvyMdxaN/EI3Up9+pcy3mkrP1cHgx7+wUmhpuuIbtwGVV6OGfRFnxntIj77Ec7xlu6 gVkQ== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SYlgfxgP8xA9b/qpZI8ocxmaMtZMiVXOlBpcw4zbmWY=; b=lK3aSq6MJfTAmzBaP59//p3Je/XXSvehrucr/6MehSq6F2sIvA9jVgSQpkUdXrXf7K kF4XLbYE3TDryTOHFahdd4SwEyDXNMT1LmmxNkJHL9XWVWPwDfrfzxhpBdji76oVNR52 UjDdu6R7AnfkTyOfWSYPzPQuTtL7NWn6kuVR/3gOwLdxSdJ5Sp1qAz5YnIyQWHfDzORd 30WTZnzk1fyHITuPd5rdN0VrEO5KBuTrzyEFMd09KQVhDkmeS90DhRBSA1DnNOoKxlMJ IBQwjIscDM3KunK4lQj9JU8L+gtbaslIPc9K/umEK0te+CcDeDw9Ur5CmG4pNh5e7Hga Mssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XmtQyiBx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si2215798eds.428.2020.04.23.21.55.14; Thu, 23 Apr 2020 21:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XmtQyiBx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726028AbgDXEx2 (ORCPT + 99 others); Fri, 24 Apr 2020 00:53:28 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:52231 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725554AbgDXEx1 (ORCPT ); Fri, 24 Apr 2020 00:53:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587704006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SYlgfxgP8xA9b/qpZI8ocxmaMtZMiVXOlBpcw4zbmWY=; b=XmtQyiBxREf/SPUL4FmX7j8fMilyzzblYpdlT4EMUsg1jhSiqGaCjiwtQkZZ9w3Rzib9nu YdtHzWKc7R40PR9tBY+t7q9/33qpmsigNp+2slhhLV++878RgG6AX8RT9GuWjb9i5QvOQR wA6e37KrLAU3+gP0lmooIp6cU1qP4OM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-gEHt2BK4PhOOsngnp6_TgQ-1; Fri, 24 Apr 2020 00:53:23 -0400 X-MC-Unique: gEHt2BK4PhOOsngnp6_TgQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F9EB107BEF5; Fri, 24 Apr 2020 04:53:22 +0000 (UTC) Received: from localhost.localdomain.com (vpn2-54-127.bne.redhat.com [10.64.54.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id D31F0600E8; Fri, 24 Apr 2020 04:53:19 +0000 (UTC) From: Gavin Shan To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, shan.gavin@gmail.com Subject: [PATCH] arm64/mm: Reject invalid NUMA option Date: Fri, 24 Apr 2020 14:53:14 +1000 Message-Id: <20200424045314.16017-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The NUMA option is parsed by str_has_prefix() and the invalid option like "numa=3Do" can be regarded as "numa=3Doff" wrongly. This fixes the issue with sysfs_streq(), which have more sanity checks, to avoid accepting the invalid options. Signed-off-by: Gavin Shan --- arch/arm64/mm/numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 4decf1659700..bd458b28616a 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -29,7 +29,8 @@ static __init int numa_parse_early_param(char *opt) { if (!opt) return -EINVAL; - if (str_has_prefix(opt, "off")) + + if (sysfs_streq(opt, "off")) numa_off =3D true; =20 return 0; --=20 2.23.0