From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B86EC433EF for ; Fri, 1 Apr 2022 14:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348031AbiDAOg4 (ORCPT ); Fri, 1 Apr 2022 10:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348552AbiDAOen (ORCPT ); Fri, 1 Apr 2022 10:34:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98179BC7; Fri, 1 Apr 2022 07:32:53 -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 480E8B82500; Fri, 1 Apr 2022 14:32:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC12EC2BBE4; Fri, 1 Apr 2022 14:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823571; bh=JdRrg21BJ0EHLQ2536FbmG5Ex1B666j20GQHsg51580=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a4zPeB0ahATdWMNmMReTlywbrg1KDMZdkjhAZYoRg/L7YSBOwz3TDJhj4Ustbutzo Mut7Rt1hVLRcHBVigtyiBnBFTyENPL0N0owtkjrEGjy99lQM69UpUgoZ2DAYRPGqEG mJ2UgPgPtZixZfzE7ilnwqYB9wUN9p2pPtZf+1OtUZN+pTHYd/zWXmJdD2VMtdqKM4 fYDQLSUuaGQc4caxJZjPx8H5iHPGj5JnpnbPYh6OE6kV76kxhQc8LPt4eHQTQBCvZP lh/k4F+tClaWQIhCl7RqJJ5ZDr9SAPdrgjn53v4pb13dknZ9Ag2zOBpdwZHjsw8aF2 nw31Nnyn0DE5w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Randy Dunlap , Igor Zhbanov , Ingo Molnar , Greg Kroah-Hartman , Andrew Morton , Linus Torvalds , Sasha Levin , rostedt@goodmis.org, mhiramat@kernel.org, ahalaney@redhat.com, vbabka@suse.cz, linux@rasmusvillemoes.dk, wangkefeng.wang@huawei.com, keescook@chromium.org, mark-pk.tsai@mediatek.com, peterz@infradead.org, valentin.schneider@arm.com Subject: [PATCH AUTOSEL 5.17 148/149] init/main.c: return 1 from handled __setup() functions Date: Fri, 1 Apr 2022 10:25:35 -0400 Message-Id: <20220401142536.1948161-148-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Randy Dunlap [ Upstream commit f9a40b0890658330c83c95511f9d6b396610defc ] initcall_blacklist() should return 1 to indicate that it handled its cmdline arguments. set_debug_rodata() should return 1 to indicate that it handled its cmdline arguments. Print a warning if the option string is invalid. This prevents these strings from being added to the 'init' program's environment as they are not init arguments/parameters. Link: https://lkml.kernel.org/r/20220221050901.23985-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Ingo Molnar Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- init/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init/main.c b/init/main.c index ada50f5a15e4..9a5097b2251a 100644 --- a/init/main.c +++ b/init/main.c @@ -1192,7 +1192,7 @@ static int __init initcall_blacklist(char *str) } } while (str_entry); - return 0; + return 1; } static bool __init_or_module initcall_blacklisted(initcall_t fn) @@ -1454,7 +1454,9 @@ static noinline void __init kernel_init_freeable(void); bool rodata_enabled __ro_after_init = true; static int __init set_debug_rodata(char *str) { - return strtobool(str, &rodata_enabled); + if (strtobool(str, &rodata_enabled)) + pr_warn("Invalid option string for rodata: '%s'\n", str); + return 1; } __setup("rodata=", set_debug_rodata); #endif -- 2.34.1