Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2181061iof; Tue, 7 Jun 2022 22:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlw7RHJEppf8+QfxDbR0Tw+LL0BRwQn5zQ2HteEEZo87Qw0GPVocRz8ceGLRKWZ9qPN4AT X-Received: by 2002:a17:902:f34c:b0:163:fa4f:2ff5 with SMTP id q12-20020a170902f34c00b00163fa4f2ff5mr32165298ple.174.1654665810579; Tue, 07 Jun 2022 22:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665810; cv=none; d=google.com; s=arc-20160816; b=PwPVGQt3G6T5VAvU7MUwUbD/RTQaBlMb1clspy13TRZp6NC3LVB5NqkFbEZeseRRqp FdGtW8g9gqHlyIORVjSBxDEe7eeDiQGYkABOesVIOxRflwWHwLSSVAoP2RkTxzNZUgFm yCvgo86RLTPz6eFEYMpQJpRObFUafnIQPaN4YJ9iJ1XK8C0gAUIUz50oFAVfMzCsLW+g dCnS/noYE711vpXA/KdhkCLCmDV1TsMpHa719Wlzu/F1baGayhd8t8isOWHkhb9RqV2W x+QxHKkLlpzsjoTOgKnOvxIWoyCt0GMdV3V69kiHo2U1fthci9OxhCnVEowPqCuTnzXI AhNg== 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=LwkizGT8ftFqWVYCb55EgzxPkrNAlLKZCh7phcYWa6I=; b=o1WfDdR66Yf4eENESS5AhyrGY4jh3LpG06O7tD97tbONPuVDc6OjQyhkun7GoFMHDj MhbZcCcBzEU5ysABJWpW5AefqFjx1T7l/hvN4J2jVSzRwkgE80sBs0+D6Gqw3rAKTGDy /ueqGhmdfd9krsDfBlz/LOP+cGHgQhvYgKhl+kjKHJe0vUIc3PgV2Q/SOvSWiE/kPkDD jz5aPTs4I+LuVhTl+Dx942PlTGu2W9a6jPid3R1NemZg4XZ0IBn56Wc/7lvvLcnJ0P1a hH7DvJ7Y00nBv66waY6tLy36o3+3BQlT+j+/Xgk2tA0uF2Fi9NqvwE3W+GeKIUw4+xAq x4rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pJ0YfWJ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id jg18-20020a17090326d200b0015e9ff43b64si23392578plb.585.2022.06.07.22.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:23:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pJ0YfWJ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 D4A46350892; Tue, 7 Jun 2022 21:50:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351764AbiFGWmo (ORCPT + 99 others); Tue, 7 Jun 2022 18:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380772AbiFGVbQ (ORCPT ); Tue, 7 Jun 2022 17:31:16 -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 3DCACAEE04; Tue, 7 Jun 2022 12:03:27 -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 C881F61807; Tue, 7 Jun 2022 19:03:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFBCBC385A5; Tue, 7 Jun 2022 19:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628606; bh=xJEmcH7BdIMe2MshrxICDjoyR5Wr/24nzN4gOgNNMsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJ0YfWJ14BCUfUrmag1tEJcSM2dutWdPlXR2TzxnpV+T3vLAXwSr1Kh743QpvIBuk 9s62XYy09n+j1wcrYBMYym1g8UZP6y6c3VWf0L56EsjQwkKj3deN+8QoJBe2bNLLnI 64nHzJcbOuyJ7H9MAiiNPRU50SfF1ghsBSksSOeU= 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.18 390/879] x86/mm: Cleanup the control_va_addr_alignment() __setup handler Date: Tue, 7 Jun 2022 18:58:28 +0200 Message-Id: <20220607165014.185340434@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 660b78827638..8cc653ffdccd 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