Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp625389pxb; Tue, 5 Apr 2022 16:22:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1lFpyLGnnBZ2Rb/0UelGu00LsPWzfOipQTZr2qxgiQO5SFVfDpkRwpzYF7lHbQT+OS55S X-Received: by 2002:a17:902:f349:b0:156:a80b:a53f with SMTP id q9-20020a170902f34900b00156a80ba53fmr5942909ple.7.1649200956527; Tue, 05 Apr 2022 16:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649200956; cv=none; d=google.com; s=arc-20160816; b=f/1wjNmbIkTk/4I3oxe77sJNvK6PCr21D302sCr4lEBw6BCRQjxRTzNCXJFy1YZETl GfBOCZyeytmqO10VvK9adS/FpkWHOwR9E0NoN+7hOB71Ol+n9XgoKLklFoD6irFKlH4+ eWsJfxBJqI08hyPA4kRIzpgfD68xaGf6J7syF1dfis2kZHogVG4ZEYkvRaxLMACHYps9 d8eUw8cASRO8fXl/fv3EZcO91JCbaF+pmZrAJwEnfU9tHbywdmPudAS4fK3ksMbARgZR No6z9bU0WN/72+4lzxj6u4SQQbNsE6czeDt1ZtLWYoYXl4TdK++zDR+EZU2zxp+oEXWo xOLQ== 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=1PpbyrusbJx5hmjQj8kcTk+6TaTz9XJ3G1h9pdgvEss=; b=jUTvVPlMltfcjo3avw7WYCBW1q0ujigTsh0NuFYa/nB4Yg/qhfZw2V7UnG4f5Hkncl NHtPlJBOSF7t4e5g38DiIVenucN6lZ138leg3ldE024JU8Ul2x9EdkC6GrIF4tl0JDYC nDfB8zdzgVq3lA85TPri7C7vIS2WBp/UbXySvVU4JipNndDw35G4KfLSUQsuHMYvlenH DbEGmZOZD6cm96qI0JKSuuQEYm/Tm+W1/UvDlMgN2xkp1MNOxK2lDiY0kUfgcuJnfk31 NcwesAeys5vvGF/ghxzJY7SQcEA6PnckFG3uWqHO7ZD3GzINt3S/3AEf2q/OEQeTChQU m8GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TmwrsoVh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id b16-20020a17090a489000b001bd14e01f95si2896706pjh.131.2022.04.05.16.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:22:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TmwrsoVh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B51E23DEA9; Tue, 5 Apr 2022 16:07:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356509AbiDENII (ORCPT + 99 others); Tue, 5 Apr 2022 09:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344025AbiDEJQw (ORCPT ); Tue, 5 Apr 2022 05:16:52 -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 2C13B2603; Tue, 5 Apr 2022 02:03:47 -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 BBCDB614E4; Tue, 5 Apr 2022 09:03:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97B08C385A1; Tue, 5 Apr 2022 09:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149426; bh=pLIQlGkUzPkW36H+QN7RfbIl6w439D/LXITrrVw3+x8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TmwrsoVh2l2NNPAGjykVdX8sg8wNB9SJhWK7PZL7rs9iqw0G+ASG5kEuPlc9rSlOr t0sjhxIMHOLrXlYCVZuZ+q/NKrCpnIKPrNmwxlgGrHu6DlOfUG02g3yoIplBPqzzs3 pN6V+QG6p016pSbqUiJjV6j28u62A8Y/nTj5NTfE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Jason Wessel , Daniel Thompson , Douglas Anderson , Arnd Bergmann , Igor Zhbanov , Randy Dunlap , Sasha Levin Subject: [PATCH 5.16 0709/1017] kgdbts: fix return value of __setup handler Date: Tue, 5 Apr 2022 09:27:02 +0200 Message-Id: <20220405070415.316309603@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-2.0 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=no 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 96c9e802c64014a7716865332d732cc9c7f24593 ] __setup() handlers should return 1 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 kgdbts_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: e8d31c204e36 ("kgdb: add kgdb internal test suite") Cc: kgdb-bugreport@lists.sourceforge.net Cc: Jason Wessel Cc: Daniel Thompson Cc: Douglas Anderson Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reported-by: Igor Zhbanov Reviewed-by: Douglas Anderson Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220308033255.22118-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/kgdbts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 67c5b452dd35..88b91ad8e541 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c @@ -1070,10 +1070,10 @@ static int kgdbts_option_setup(char *opt) { if (strlen(opt) >= MAX_CONFIG_LEN) { printk(KERN_ERR "kgdbts: config string too long\n"); - return -ENOSPC; + return 1; } strcpy(config, opt); - return 0; + return 1; } __setup("kgdbts=", kgdbts_option_setup); -- 2.34.1