Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6737097rwi; Mon, 24 Oct 2022 05:36:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ghfikcjLcoFqhCvhA1h7svF5B/9qRE7Xj+JFtG5Kp3tQ5n8cfVW6qOe2c+gvD72QVfWwi X-Received: by 2002:a65:4084:0:b0:463:aa4:49cf with SMTP id t4-20020a654084000000b004630aa449cfmr27776875pgp.164.1666614980616; Mon, 24 Oct 2022 05:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614980; cv=none; d=google.com; s=arc-20160816; b=0qmko3V7M9Hia5+bGuyzCXpg1zDeGhugMn3Wqpt+3yM33qHGxwmDrXqbV69cBgfRrI dS5GSdQTTrkoC8/DHk3mB5/FME9H9K6bRYgwYNhq6/sFGcsd1wOpKKloagh3Tn3tDUs+ XgeNtVAxCV5B617MhJGGIBMH4z9v4CxmRQF3+iIfSnrxjvUkNcSA5rfcKo1+8cfkL5Gz 90k+C8XWShs7PZdFoJepUrpxg+piEisw2eP8dNOb9mHlY3w6ZXd5yH5+S2m8Ki3lrXlF SXN7ygNSCd9SA+U/OGSXOnxDuO1eVwBycr7qQXHdNQ44fHL0e9UhsmrG3YQgEg0MZZS4 85sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=e8GBMNh+XXDTSkjTm/lnjUZKLvgjWvtF+cj2BlD2ZKM=; b=S71W+ek0wFCMtd2trDZuMEYXFWe7Ea3p+jkmv5zZvg8yRCUFb2jjlM6VyrHOb960DB BJ7PzzLARk2OxF7isYFIp/LowdLZ99aAlfwWfkzoNCVJ8Jq0IBnL+NsD/1SJnpCrUnTa 6l7qABc6GPguC6pPNtz+sIOJ+5+lUhN003CB/b0qJla5GjZnAs5rxcWg2n2QCBDZUuFV k2ZBtTLBsxX+ANjgnTaU7VVkwhdW2hSKZcX2s3QkZnqzXRRwbsbDxTMxIfj7NF4eZdr1 X3RsbLD1nBhYIOmuyEOyWWJ/Szl3T2YSUJcdnXg6vikILtydXpkdAWEZwMw+VBzz3s7a +DWw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a170902db1000b001865c1ecf30si10305092plx.176.2022.10.24.05.36.06; Mon, 24 Oct 2022 05:36:20 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbiJXL1Z (ORCPT + 99 others); Mon, 24 Oct 2022 07:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiJXL1X (ORCPT ); Mon, 24 Oct 2022 07:27:23 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D925AC77 for ; Mon, 24 Oct 2022 04:27:22 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mwt2s60GlzmVKK; Mon, 24 Oct 2022 19:22:29 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 24 Oct 2022 19:27:20 +0800 Received: from [10.174.179.234] (10.174.179.234) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 24 Oct 2022 19:27:19 +0800 Message-ID: Date: Mon, 24 Oct 2022 19:27:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH -next] init/main: Use strtobool for param parsing in set_debug_rodata() To: Mark Rutland CC: , , , , , Guohanjun References: <20221024093817.3003291-1-tongtiangen@huawei.com> From: Tong Tiangen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 在 2022/10/24 19:00, Mark Rutland 写道: > On Mon, Oct 24, 2022 at 09:38:17AM +0000, Tong Tiangen wrote: >> Aftern parsing "full", we can still use strtobool rather than "on" and >> "off" parsing in set_debug_rodata(). >> >> Fixes: 2e8cff0a0eee ("arm64: fix rodata=full") > > Why do you think this is a fix; what do you believe is broken? > > As noted in the commit message for 2e8cff0a0eee, we *deliberately* don't use > strtobool() here so that we don't accept garbage values like "ful". > > NAK to this patch as it stands. > > Thanks, > Mark. Hi Mark: Ok, missing that. Thanks, Tong. > >> Signed-off-by: Tong Tiangen >> --- >> init/main.c | 8 +------- >> 1 file changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/init/main.c b/init/main.c >> index aa21add5f7c5..f420e20b1fa3 100644 >> --- a/init/main.c >> +++ b/init/main.c >> @@ -1463,13 +1463,7 @@ static int __init set_debug_rodata(char *str) >> if (arch_parse_debug_rodata(str)) >> return 0; >> >> - if (str && !strcmp(str, "on")) >> - rodata_enabled = true; >> - else if (str && !strcmp(str, "off")) >> - rodata_enabled = false; >> - else >> - pr_warn("Invalid option string for rodata: '%s'\n", str); >> - return 0; >> + return strtobool(str, &rodata_enabled); >> } >> early_param("rodata", set_debug_rodata); >> #endif >> -- >> 2.25.1 >> > > .