From patchwork Sat Jan 14 17:33:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 43784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp382416wrn; Sat, 14 Jan 2023 09:40:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXvTWCGCZGhV9Bz/Dt6T7rPdj7hZKmzHpeLucW/8g7SLLijh6fYqJANr+dPQthK1LGkSTiRY X-Received: by 2002:a17:902:ce08:b0:189:81dd:6b8b with SMTP id k8-20020a170902ce0800b0018981dd6b8bmr113353600plg.63.1673718005385; Sat, 14 Jan 2023 09:40:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673718005; cv=none; d=google.com; s=arc-20160816; b=l9lKMG4SfPiYDdu5ENJrazwNlCwlCDyP6SNQs/OnrpMesMkthHTbyOrXH0QHhG+uJL uTRXjL+NB/mvwdDJUIMoBm8decEt/14Tev7YtQrVG6T/Oiz/CfmXXMRG0/4w2Govu87A luruUIQK8N1AHN6eTVKJ8+eDWDuwThR3f/Ob4r01EQS1UDEO4cES8It9E+NaGluoRB+T e/s4XshPOg2tanRGpk4E8QcPMVn0JjzHkDQ2HXgHjKy2yFaW6jkBiJZJZPqymOdkpPRL 3prxNV6WDTRB/BssOlmmIt+dhvtaoUBp9dZVBTgKpPHyLJMOhgJuasWarEw5Qgkj95KM huwg== 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 :message-id:date:subject:cc:to:from; bh=2jqY7L14xJNjk1/H9AG+X7OhA7ovq8QcducpQFc6wL0=; b=EEzd61i/ccu1ZdWQHNIMb7XYCdNlvhInVnAvaxXeUvyQjZSZeB6jsrfPQVKAuA/ACd /w4f6T2kVSiDVXZu8ncgupN0iADodIs1/EIcWMV9AT9eAMXQ2xI4iSVRjcAfNULx7ZbR hlBnneN91rEjx/qAxzr/459ZmDAxBA3kDVm/NjexFX0bZtbzM6jUg5RVN+Wyc6eX7cug 1aTDSBdOf1EH/0or3TE4aamWRg/hQu+ZCFpIG0xAovrs1oud2Zwk16sBKhyUvHkCUTka tLBYQRTb10lqGp9Lc+1qg2nRTJKc9DoREc14b6yyGBhxevuhOeOzXwNXw+dQ6hEXzMSE 3Tmg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a170902e94800b0016d2e8c2233si23880397pll.333.2023.01.14.09.39.52; Sat, 14 Jan 2023 09:40:05 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjANRd1 (ORCPT + 99 others); Sat, 14 Jan 2023 12:33:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbjANRdY (ORCPT ); Sat, 14 Jan 2023 12:33:24 -0500 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18BCA5FC for ; Sat, 14 Jan 2023 09:33:22 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id GkP6p29fEI2kPGkP6pk30A; Sat, 14 Jan 2023 18:33:21 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 14 Jan 2023 18:33:21 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Chang S. Bae" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Borislav Petkov Subject: [PATCH] x86/signal: Fix the value returned by strict_sas_size() Date: Sat, 14 Jan 2023 18:33:09 +0100 Message-Id: <73882d43ebe420c9d8fb82d0560021722b243000.1673717552.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755020531597031989?= X-GMAIL-MSGID: =?utf-8?q?1755020531597031989?= Functions used with __setup() return 1 when the argument has been successfully parsed. Reverse the returned value so that 1 is returned when kstrtobool() is successful (i.e. returns 0) Fixes: 3aac3ebea08f ("x86/signal: Implement sigaltstack size validation") Signed-off-by: Christophe JAILLET --- This patch is completely speculative. Review with care! My understanding of these __setup() functions is that returning 1 or 0 does not change much anyway. I spot it and found it spurious while looking at something else. Even if the output is not perfect, you'll get the idea with: git grep -B2 -A10 retu.*kstrtobool | grep __setup -B10 --- arch/x86/kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 1504eb8d25aa..004cb30b7419 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -360,7 +360,7 @@ static bool strict_sigaltstack_size __ro_after_init = false; static int __init strict_sas_size(char *arg) { - return kstrtobool(arg, &strict_sigaltstack_size); + return kstrtobool(arg, &strict_sigaltstack_size) == 0; } __setup("strict_sas_size", strict_sas_size);