Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp719932pxb; Tue, 5 Apr 2022 20:13:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgHqB1d60X/NebAgP1Jr+nlTJNQN8R0V120JiRn9o2sJC927njAx7nCPgV1u+WEZBdPHCW X-Received: by 2002:a17:90b:4b10:b0:1c7:5b66:28df with SMTP id lx16-20020a17090b4b1000b001c75b6628dfmr7477002pjb.33.1649214823261; Tue, 05 Apr 2022 20:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649214823; cv=none; d=google.com; s=arc-20160816; b=AdxhNCjxIKMaJDU4r4ygxMYAbDXaOckkQyn7coIp2qfVNDR18+0JXAn9QvdSU6mj9S gQig2dd4/Hu8teUjReshbX6WeK7DsMx/7vYtYBk7l/A4pqXOdLY3V5eqp9KogyTn0wfE ZjCpNjocugkpjADNtCfdR4YGEgesKl29vu5iHwbTHhM43r1KnD7oAf6mY4pFRlWrnCwL tWw6t9rJF7bfIQ56edveIQG4wpJbR1Igte9Hf3HUJJtJGakpOXZldhk6DVi61C29QtPC LWJKZENHTplULPOqwJIWp4aih3l5TQPPHSzfwEuG6TwOu3Df17KV0JegBU/aaGzI7Bml qHBw== 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=SHrKv+x/eaoMVDTyAqr+edfhWXRWSg3sDwA6pZhKBMI=; b=x/3+E72fMXBUQinyIa00aB0BQp83x7T1OFFRA0XgNjCm9J2gz2F3zURwkzhxWaPgoC 7H/I41bT9pEBOTD9NebdN3CaztGTiZuMWup0vKX3HZEkdn1NR75hxSemPrCGn8QbeG8/ 9D8/jJRkK4d1W7tZQvTBl7O2/rBEj5afvBB+ktyE0G6PBItaGtXVHsqVU4uR8Wf4fz08 vU7JEQ2e9Nstspt8M9eJsxocE0FdGuWiuiTOIc4+awQR7H2ZaedjexbMEJ+JSUirlD5N A16SMS2NKawup5aeTrRYpMryZQs5ktLvXkVb0WUmSAedzgQttaebaTOJkXAW1DHPyWRe 73SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DKn9AjFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b2-20020a170902b60200b00153b2d164casi14476162pls.210.2022.04.05.20.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:13:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DKn9AjFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 767F62F0B00; Tue, 5 Apr 2022 19:53:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbiDEJhn (ORCPT + 99 others); Tue, 5 Apr 2022 05:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239427AbiDEIUE (ORCPT ); Tue, 5 Apr 2022 04:20:04 -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 77C5091350; Tue, 5 Apr 2022 01:13:01 -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 E9A1160B0B; Tue, 5 Apr 2022 08:13:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8094C385A2; Tue, 5 Apr 2022 08:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146380; bh=qQXWyRu4TEliDafq6CKePkOIo5nPfDxb/EyW2btOqvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKn9AjFAgNYTZ8ZY/D1JzgRs5xbfUfELO6+zglFpRfN4qs/k7QeO4sADfq4YUqd5R yvkle/zq2NsKzOAglO2EIUa+nvLfkqdF+L4ZbwWOu5JO6edRyHX5fQmvJf3LbeMlay bFAkWoCQ4MQ2U4M0cAwYloia316aIZpHWcvCF3Bg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , Igor Zhbanov , Joerg Roedel , Christoph Hellwig , Marek Szyprowski , iommu@lists.linux-foundation.org, Robin Murphy , Sasha Levin Subject: [PATCH 5.17 0742/1126] dma-debug: fix return value of __setup handlers Date: Tue, 5 Apr 2022 09:24:49 +0200 Message-Id: <20220405070429.365761334@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=-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 80e4390981618e290616dbd06ea190d4576f219d ] When valid kernel command line parameters dma_debug=off dma_debug_entries=100 are used, they are reported as Unknown parameters and added to init's environment strings, polluting it. Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100", will be passed to user space. and Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100 Return 1 from these __setup handlers to indicate that the command line option has been handled. Fixes: 59d3daafa1726 ("dma-debug: add kernel command line parameters") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Joerg Roedel Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: iommu@lists.linux-foundation.org Cc: Robin Murphy Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- kernel/dma/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 7a14ca29c377..f8ff598596b8 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -927,7 +927,7 @@ static __init int dma_debug_cmdline(char *str) global_disable = true; } - return 0; + return 1; } static __init int dma_debug_entries_cmdline(char *str) @@ -936,7 +936,7 @@ static __init int dma_debug_entries_cmdline(char *str) return -EINVAL; if (!get_option(&str, &nr_prealloc_entries)) nr_prealloc_entries = PREALLOC_DMA_DEBUG_ENTRIES; - return 0; + return 1; } __setup("dma_debug=", dma_debug_cmdline); -- 2.34.1