Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2164150iof; Tue, 7 Jun 2022 21:53:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU47ej/b4z8hsAhFz+89T1WYGqbDqeugeqqDJVCq4rcx/2K0ygIOjxmnyeYq2xyB18jyqx X-Received: by 2002:a65:4501:0:b0:3fc:4895:283b with SMTP id n1-20020a654501000000b003fc4895283bmr28353700pgq.231.1654664017332; Tue, 07 Jun 2022 21:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664017; cv=none; d=google.com; s=arc-20160816; b=unNVlea7KR6KWHabd7uDeQI+5ldAItNta7cutNhEctnrpGnCeA1yZvdDtlnm4YyYhQ Jtf2wYzyVgHjKZnDh1QTajh0iZnaUuCR4cavc/2oFHya1JBw1N+v1lq3pLQgAA1nOqOG kMSUE0ysWYztBhny4+VXPrv5TcPJrNAV2y0dOURiaZimxoGFrT1wL51kZnL49tN7rsPf Shmo1JR8Mhfqa6la7NXx9x4muYSv1rFrDdgK9k+5Yd4VIOHizQqTyShSHkAd19OD7+3j kR/VI4n7ve/I38lcTq52M2Mr2kf8+eX+YI/bsX0Cg8Eb0KtC2NkvsgcsLpkmQxCxtn8R rTwQ== 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=Y7RJNEyUVYkRR78tH16k1uSsU8dn6HuPTD4NgqhM5XI=; b=xJ/OdK1QTaBZAB4uNEGT+ASqy/UDqom7bt/onu1+aCFsft/1pqlXgxKLJv8q3jKm55 f/U9OM1tpUDBtfFlb/M0WEvKMPZFooRQWH8OANxy5esOhimBpqaZJS5HLTnJa1w8rid4 5fep5qiRZPd1Q0/73XJcZkH3TkV4GrKcEEODb1jkhAwIkYoRautglj+RoMIHr4CWKEBO l2oq7Tb+W8W3csejgPg+Ac+5Olni78nKoKyBAbypCNbaKERz27iZog7yqM5e91YjWIMv AKuFmTI6McWTLuqgzq7hEHxhxX9fj1nJzKJwJ/1dfNaN4lTaxga/KWweH/3rcHod0Ewt xfeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eFOgECEb; 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 w2-20020a631602000000b003fd2602f461si18829602pgl.88.2022.06.07.21.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:53:37 -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=eFOgECEb; 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 16645457380; Tue, 7 Jun 2022 21:23:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384867AbiFGWpF (ORCPT + 99 others); Tue, 7 Jun 2022 18:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380609AbiFGVbE (ORCPT ); Tue, 7 Jun 2022 17:31:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB13913F416; Tue, 7 Jun 2022 12:03:14 -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 ams.source.kernel.org (Postfix) with ESMTPS id 165B5B823B0; Tue, 7 Jun 2022 19:03:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 811BFC385A5; Tue, 7 Jun 2022 19:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628591; bh=E5gEfAVwafdnSrkfLZUGm24EulVo8k7DNIIOMIY8yuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eFOgECEb/SBex4w+GvVnTr1luWQNblh6/P1yjyPRTrgTLCcx3iitPcyz77fGTlLg+ 2YBKSXH/+Iwi2FSCHY75cwZmNuHyIJjZADPm+ZhxVv8n9KY+epZsS+L1RIm49med0T Y0eSQwiAiLCTuNypvmCk8eZ5XJrMtyCf6luv44D4= 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 386/879] x86: Fix return value of __setup handlers Date: Tue, 7 Jun 2022 18:58:24 +0200 Message-Id: <20220607165014.069692633@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 12441ccdf5e2f5a01a46e344976cbbd3d46845c9 ] __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument (no '=') or environment (with '=') strings. So return 1 from these x86 __setup handlers. Examples: Unknown kernel command line parameters "apicpmtimer BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init apicpmtimer with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable Fixes: 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Fixes: 77b52b4c5c66 ("x86: add "debugpat" boot option") Fixes: e16fd002afe2 ("x86/cpufeature: Enable RING3MWAIT for Knights Landing") Fixes: b8ce33590687 ("x86_64: convert to clock events") 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/20220314012725.26661-1-rdunlap@infradead.org Signed-off-by: Sasha Levin --- arch/x86/entry/vdso/vma.c | 2 +- arch/x86/kernel/apic/apic.c | 2 +- arch/x86/kernel/cpu/intel.c | 2 +- arch/x86/mm/pat/memtype.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 235a5794296a..1000d457c332 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -438,7 +438,7 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs) static __init int vdso_setup(char *s) { vdso64_enabled = simple_strtoul(s, NULL, 0); - return 0; + return 1; } __setup("vdso=", vdso_setup); diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index b70344bf6600..ed7d9cf71f68 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -170,7 +170,7 @@ static __init int setup_apicpmtimer(char *s) { apic_calibrate_pmtmr = 1; notsc_setup(NULL); - return 0; + return 1; } __setup("apicpmtimer", setup_apicpmtimer); #endif diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index f7a5370a9b3b..2c87d62f191e 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -91,7 +91,7 @@ static bool ring3mwait_disabled __read_mostly; static int __init ring3mwait_disable(char *__unused) { ring3mwait_disabled = true; - return 0; + return 1; } __setup("ring3mwait=disable", ring3mwait_disable); diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index 4ba2a3ee4bce..d5ef64ddd35e 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -101,7 +101,7 @@ int pat_debug_enable; static int __init pat_debug_setup(char *str) { pat_debug_enable = 1; - return 0; + return 1; } __setup("debugpat", pat_debug_setup); -- 2.35.1