Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441709iog; Mon, 13 Jun 2022 06:05:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCYtLNvXJrv5yX2hTiu3E3HJOlyrp/pEN6m8rn+4isUnTaG7O7oX81zsB8+S3N4PP7F22S X-Received: by 2002:a63:6a4a:0:b0:3fd:4f3a:3f0f with SMTP id f71-20020a636a4a000000b003fd4f3a3f0fmr42851371pgc.625.1655125517820; Mon, 13 Jun 2022 06:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125517; cv=none; d=google.com; s=arc-20160816; b=w+mqgRKVnINhUsVI06PIwX2+lYVMOIAW8vgdQ2tNhT1v67O01ru2BzX38m/AfoRgzs /maQLfW/QIEwPeikVjY5gqUfcTCOqC4eugqcVte7XynjbflxZrDvWCuAuC4NzSX2LeiI +E+z5u2hYmyG7L1r1EGbRBp8lVtQ9pIX827F/duzjcc2RPg4GNGA+ug1TeW9pqbsay6L UDnddn5bpPzqb0/8P5bazvF0dlIfNCQKrct2kAHQ+nGw0NHHgJn83KKebADxRFGK6y0y 7E8Z7+YmLa3EX64EArhKmkytIsZyiMYh1WIuW/rbbgdFCMWQB6YXe4PpapZvammZtFY5 pyCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qSCKkMu+EKSOaL+QJG+qg7iw1YjNfDaNXTQZik+HRX0=; b=pLyuqv/XYB+AdrzWlfqBSs4qWb02Bbms0tI2CP3xDgmdMGuRazgh+x3Fs9Oi9Rv1No 5P8ck1Wv0NOp++3uY2XyDKG/W2WK3M7u8Btl3g76V56fNa+mcybFWYELaCrgWNZZkxZ2 yOFy9bQ1VBX2fXwDD+TUT0OIF1+yXFTWGzkmY758tJTIT0MzZIcTJnBF2qH0aOnnKN37 lLDu4tsa9+YCGKwamLIIXpBUcyHIhtFIiSxCzvf+OH/hoMqMh8FbKER7gaFbfzI+upcc DjEqN3rSSAjPlwpaPT45MxQWIY9mmqBcteUVcbAGZIFjwuTlnsX4dVAjcrepqQCqLjs2 RtOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tN1Z+pQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u20-20020a056a00159400b0051be19af20bsi11429921pfk.13.2022.06.13.06.05.04; Mon, 13 Jun 2022 06:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tN1Z+pQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236317AbiFMKTi (ORCPT + 99 others); Mon, 13 Jun 2022 06:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242544AbiFMKSX (ORCPT ); Mon, 13 Jun 2022 06:18:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA34E20BCC; Mon, 13 Jun 2022 03:16:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1CA6461496; Mon, 13 Jun 2022 10:16:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC4BC34114; Mon, 13 Jun 2022 10:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115371; bh=3vkbMjgCXrBgL/xZkwP7WAfVx/yScR4D/3UM/AEGANA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tN1Z+pQkBW0jmcJd9/1jD4F3eEtirverunYORQbZikWdiupB1yGAz4ZS8QzwtrOHC sw/iu9bTcBfllG6n8OjEjF3D2k9et24AaVcqHufpFgfd7ecv0pnUNyGGz4ZtbpW4cZ OvTuiH5K3UbH9WCiT0Z60ZcmsXTjQNjn/JiO7MiI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Igor Zhbanov , Randy Dunlap , Borislav Petkov , Sasha Levin Subject: [PATCH 4.9 050/167] x86/mm: Cleanup the control_va_addr_alignment() __setup handler Date: Mon, 13 Jun 2022 12:08:44 +0200 Message-Id: <20220613094852.716797967@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap [ Upstream commit 1ef64b1e89e6d4018da46e08ffc32779a31160c7 ] Clean up control_va_addr_alignment(): a. Make '=' required instead of optional (as documented). b. Print a warning if an invalid option value is used. c. Return 1 from the __setup handler when an invalid option value is used. This prevents the kernel from polluting init's (limited) environment space with the entire string. Fixes: dfb09f9b7ab0 ("x86, amd: Avoid cache aliasing penalties on AMD family 15h") Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Link: https://lore.kernel.org/r/20220315001045.7680-1-rdunlap@infradead.org Signed-off-by: Sasha Levin --- arch/x86/kernel/sys_x86_64.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 1d4e7fd3e66d..1078705292fc 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c @@ -66,9 +66,6 @@ static int __init control_va_addr_alignment(char *str) if (*str == 0) return 1; - if (*str == '=') - str++; - if (!strcmp(str, "32")) va_align.flags = ALIGN_VA_32; else if (!strcmp(str, "64")) @@ -78,11 +75,11 @@ static int __init control_va_addr_alignment(char *str) else if (!strcmp(str, "on")) va_align.flags = ALIGN_VA_32 | ALIGN_VA_64; else - return 0; + pr_warn("invalid option value: 'align_va_addr=%s'\n", str); return 1; } -__setup("align_va_addr", control_va_addr_alignment); +__setup("align_va_addr=", control_va_addr_alignment); SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, -- 2.35.1