Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp704544pxb; Tue, 5 Apr 2022 19:32:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7BeblBGav9FzSB4I+zZHG7WAFF5kdxb6MyiblM2ieZeXz8UzafVQph5W5EQzttbziTwtC X-Received: by 2002:a63:5051:0:b0:374:5fd0:f131 with SMTP id q17-20020a635051000000b003745fd0f131mr5344720pgl.431.1649212373412; Tue, 05 Apr 2022 19:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212373; cv=none; d=google.com; s=arc-20160816; b=q245yw28h04urAZfxeSEv4iz3gMuxBPfDvgosKYclKGl72YhoL/FYPGOUkaWj1LTkF tjIbuba6TqlBrqFrW2F9rq12Bw5NMebnFG8D4/WRPA9fuT4w9V6TGExVUW5f/Nt1Uvbe lMn81imEW8NLtHYRbKIV3AsVS1nj68EySIWR5ReM7jP0mhfRJKtnYoi84ppxQlLhZL+j gfUyJ77AxYMqWi8dGaA8RZrfdfUdDnci3Gx6WxI8HGQDj9nn1ynryxMOdBwpyQcvDJin H0oFf4TpkbHoaYMzOPDOmk9w+K7dWYVlkpaWhLVcaMv3iTmsRt3b7xhWrr3yCeKrGTMm FzQw== 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=BYVW6WX01lxbIlBplOlyTJrApec1zUPjthaqTo2XYY0=; b=lCNA7fN2fmmquABIbPiE4aSM9cAEpVkBjrFOLJhRNxNxTmj2u55p19cId1q7Miy87M MqAb3uNhAnOZVez8ljeounn046O3dbWOAlRZm3IKueSPFuvmUuvc4v/rePiLjmN048sF oamVdj/pmC47nJAVNVsanCEvpBGmhJ0ooeUt7ZZlklpZ8RRXAEqyIclGPDTqd5V7fo4b TdeAknsQeKmGMepfggexd7Q1qLZ4KAF9ttGbYFNbt3coN6pN6+PTvGTYs1uu4cwvqaZk epC9HDbIW2clzz5E8C8Tn7EvRuqbnyJV3+7KXnFLMJezV7a+zHLBcXOn9d9Cdv/u9jH7 vs9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bIyOMeCM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l8-20020a635708000000b0038201fbf42dsi14517559pgb.787.2022.04.05.19.32.38; Tue, 05 Apr 2022 19:32:53 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bIyOMeCM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233573AbiDEJae (ORCPT + 99 others); Tue, 5 Apr 2022 05:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239503AbiDEIUI (ORCPT ); Tue, 5 Apr 2022 04:20:08 -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 281E6CF2; Tue, 5 Apr 2022 01:14:44 -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 B87D4609D0; Tue, 5 Apr 2022 08:14:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C036C385A0; Tue, 5 Apr 2022 08:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146483; bh=JCLM8YKiiHyma2HgpUKFb0VzrXsL8iLb6rFhuU6ooFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bIyOMeCM3OR5PYfHyUoqmtjjLthbWkued8Kdc1wDYRiNPwRxMmuAbxaWc4ydpqz6Y uY5frKN5He5HIKlsHo+DwAJxNlbH/lGNcDR+YFOSWNih1sr2THFEWscWNXuihJGiHL HGRSNXm+f/VGU4YDKpYPDvBVs0tWR1pEzZ3ctsHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, He Zhe , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, Jason Wessel , Daniel Thompson , Douglas Anderson , linux-serial@vger.kernel.org, Igor Zhbanov , Randy Dunlap , Sasha Levin Subject: [PATCH 5.17 0780/1126] kgdboc: fix return value of __setup handler Date: Tue, 5 Apr 2022 09:25:27 +0200 Message-Id: <20220405070430.471480461@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Randy Dunlap [ Upstream commit ab818c7aa7544bf8d2dd4bdf68878b17a02eb332 ] __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) environment strings. So return 1 from kgdboc_option_setup(). Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts=", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts= Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: 1bd54d851f50 ("kgdboc: Passing ekgdboc to command line causes panic") Fixes: f2d937f3bf00 ("consoles: polling support, kgdboc") Cc: He Zhe Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: kgdb-bugreport@lists.sourceforge.net Cc: Jason Wessel Cc: Daniel Thompson Cc: Douglas Anderson Cc: linux-serial@vger.kernel.org Reported-by: Igor Zhbanov Reviewed-by: Douglas Anderson Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220309033018.17936-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/kgdboc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index 49d0c7f2b29b..79b7db8580e0 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -403,16 +403,16 @@ static int kgdboc_option_setup(char *opt) { if (!opt) { pr_err("config string not provided\n"); - return -EINVAL; + return 1; } if (strlen(opt) >= MAX_CONFIG_LEN) { pr_err("config string too long\n"); - return -ENOSPC; + return 1; } strcpy(config, opt); - return 0; + return 1; } __setup("kgdboc=", kgdboc_option_setup); -- 2.34.1