Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2142335iof; Tue, 7 Jun 2022 21:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypd39a1pvSm4P1gqKVJmEfl8e8xhK8u5qRLmfhit9MEDe41BdvoA/kMLIWA3imWVLAAFcw X-Received: by 2002:a17:90b:1e4e:b0:1e3:47e4:92b6 with SMTP id pi14-20020a17090b1e4e00b001e347e492b6mr43255937pjb.47.1654661390136; Tue, 07 Jun 2022 21:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661390; cv=none; d=google.com; s=arc-20160816; b=0wO4WYRjqhCTLbutF3Uq7sc+M9TSH1ilV7nseZdjNV4AuYbqrPOQsrEVLz/4ONfW7A OleB3AQWgNMreIxeHS4aMsag22cJi4tnLZfbf8n4NUltpR23wtDzKDVu3xLrCaCVLc+C YI7mJ6NfkYuUm2PuP9sdqtV+V9eBScsWk2v9u5nAbSV6ObZxiwp0fFuQLrXHalVnTEMZ R0zZF/gSZydIL5YLwtWPJ9hwD1G+ZWEG5C4GtbalTUs5tudW8Se+EM+USbcYE/DgojPC Up1f0X678EgBkpf5V+U/a98gtbfPZyPfdWU8SqvpGcaSHOGvmg8ORN1MoNdKT0Ocvg2z RLdw== 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=Uc+ZE2AgY3HY62fDkuUbs/xTutkiks2oZpn0rjJFLx8=; b=D8gdnrB3jXsukAKPxLQsg1oJtDm1CTvf6zPBVpzNouuGY/Mr8LknzqfqRV1PUkleEX BKCXlxrbPRPMWCcHmkZVdrx+oFJA4A+Mxea3e2MyCSo8sFMn7jghjN9vbUpoGgV6aAxm se+4yc99ctzC1ajcuBZ6EjfyB25iAJoIVrmrjYeWBhUCuwDJcXl2QktA3oKhwuZ6Ug4N RvSNzsDghcJFTkaN/iEn4Pvy4+ObwrWaeVC2kwGviPEuAPvax4GMWzmYPnyyZ0PUnFQz VG2ec/akLinG8T36U1Tst4i6oJ7+0BcHxlcAqS96OBkzEkdHXbZndKFa9Kk7nMxC3C2l 65Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nGndlIJL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l9-20020a170903120900b0015eb226901csi31295866plh.595.2022.06.07.21.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:09:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nGndlIJL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA20C1979B7; Tue, 7 Jun 2022 20:41:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbiFGRrS (ORCPT + 99 others); Tue, 7 Jun 2022 13:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347422AbiFGRan (ORCPT ); Tue, 7 Jun 2022 13:30:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734D8110AE8; Tue, 7 Jun 2022 10:26:45 -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 885A660C7C; Tue, 7 Jun 2022 17:26:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98958C385A5; Tue, 7 Jun 2022 17:26:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622805; bh=h48r241w+vaBYnlM+pKVZCCbDXNuCsJBWn8C/+MdRBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nGndlIJLJMVMqWC9jHNHB4XwSBv2wXV7n6tAP2R5cMuVWEU/AtV//QJtVQmpaAllg z+UazqVGKwlYMblDmpar0OZsXkpiY/kkcpB5sfdgJtFFQ30/OKGk6lT1jHJGakK5b+ qifKSYppMpRHz3YCUaq4bVnsI60zD6w6Ong0iPC8= 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 5.10 188/452] x86/mm: Cleanup the control_va_addr_alignment() __setup handler Date: Tue, 7 Jun 2022 19:00:45 +0200 Message-Id: <20220607164914.162624879@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 504fa5425bce..3fd1c81eb5e3 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c @@ -68,9 +68,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")) @@ -80,11 +77,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