Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441799iog; Mon, 13 Jun 2022 06:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybaEejIIV3Pi8AvTI+SC0+HUDZUeUssXMk1sw85Ag5Ew1ZHno124eDKe0pik0VdEmJ+r7I X-Received: by 2002:a05:6a00:130e:b0:51b:c19c:44b0 with SMTP id j14-20020a056a00130e00b0051bc19c44b0mr59969885pfu.21.1655125398281; Mon, 13 Jun 2022 06:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125398; cv=none; d=google.com; s=arc-20160816; b=oGqrpgwgrQs3QtUw/p539qRuMawlEjBDc8GXZyK+h71gQXVPbYdNiIHDfMvuDyEBqG dv4o9QCYOpSTevZPwi1etUTPcB/URp3Tp9ZX9R/7z73o+GIke/pkoGMc53ntYkr3vjOk d5AHKpnQJO5L5Mwc49I4yoP2+6NUfP4BFP3cdAEy61HLh1kRE3Uavs0LQdqDqLbBNAUP qqbJVnpDClA8xyAbB7xIHzf5vHqkkVCdOIIBBrCUXrSGCJ7o6FrpkZOBtDuij1tV/Jre KqO7v4VtVDwxb9hZUw0rWcXLWT/YyZiW3GC6M/jlyImGd0eSstRnXVhaqbobsa//MvPQ xWRA== 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=48s6woCubIt+wmWlMBE7LQvAzrFlur8Yov62M7adXKc=; b=LvW6PwPeb7c2MSEHJRi0tEA+DQpbEDc883/4MVLv3eiolhDZjxBzcvP/0Dvo4nu5XY f0olr49DbN6Cu7kummNwy0cNC6AL+J7cLhhLdj947qcTMSVfTKlaSqMLgd8TG7Q0cfDG xfh0ns2Kx5SDovhgrhzJYGKR6McYV4wz/VDZAWXxjs00I0sApbX6qEGPDOilrbm3YJ9F BMa3YNBqQnn2UXDZuRJ1sUilT209xefQ02P7YZf1qPjKjF7PhvLoDD8tW9skYFE5WsVz ku652XSOLdkDzAM3PjPiD3hO8rH8Crg0k4TwZLlBfCYMniQH3oMWuD5yh2LbB1AkNmgj 2SAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m61JzMvW; 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 c10-20020a056a000aca00b0051c50aa4266si9607132pfl.41.2022.06.13.06.03.03; Mon, 13 Jun 2022 06:03:18 -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=m61JzMvW; 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 S1344166AbiFMKrG (ORCPT + 99 others); Mon, 13 Jun 2022 06:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346569AbiFMKno (ORCPT ); Mon, 13 Jun 2022 06:43:44 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BE2FFF; Mon, 13 Jun 2022 03:24:52 -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 sin.source.kernel.org (Postfix) with ESMTPS id 959C2CE1109; Mon, 13 Jun 2022 10:24:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84FFCC34114; Mon, 13 Jun 2022 10:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115888; bh=yrnvNt3mBGcTyTnYbe9fuKCX7u3g6VgmVXCkSxqM1I4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m61JzMvW0tOhr+CJWymNhkt3jmzf2pg9bC+389A/C+AI+bPoIN5hM13JAI6MfXBm4 7IxHo+B4j60V+6BXotOcgvBBFl8/TdqKOSPTf+iltnhelB0BG2ufhWdvatGD8RgU+N BGXZ0KCldi/Lnd7O3uFq6xbvDTIcXe0Sf9vKSnhU= 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.14 067/218] x86/mm: Cleanup the control_va_addr_alignment() __setup handler Date: Mon, 13 Jun 2022 12:08:45 +0200 Message-Id: <20220613094922.030609560@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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 a63fe77b3217..7a08c42770f1 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c @@ -70,9 +70,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")) @@ -82,11 +79,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