Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp975162pxb; Wed, 6 Apr 2022 05:48:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3BALwLCqWOz/KHzTIrjTV0pmf8+9x+fBqCGilHYX5HLffYWoyahCKysBmClxaS9rC54Dl X-Received: by 2002:a17:902:7e0e:b0:156:498d:437 with SMTP id b14-20020a1709027e0e00b00156498d0437mr8427354plm.44.1649249300635; Wed, 06 Apr 2022 05:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249300; cv=none; d=google.com; s=arc-20160816; b=Yl7WI92w5v6rp2918Tpqr8Rq0pJ4JNj1loRN3sq73AMjxSv8zJPnpXHw7wYQ3kaTFl bvBpJX7Iw8bszj8ClWfr+U2jxdbIODfzh+KdPGEWHrUuyNEA9Wj3crmqqAW8XiO9EOUE Urm5oYwzOljojuJZqLgpBGN1COtG2bD7vet004OoygKkAj55fcCD2fqkxP9TBB9j9AaJ cYEB4/71uRUsbZGTtiIs+xoyamqUB37Fy1CyMDk7Kp9K4/gnUxyVCuwD/71joyX3+dbA s9SFsHoCusPdQYniC+hI6ZSSRfQVisjsb0+hTPQGzfoHzWvgh+UYt9TYvI3VBlIdvDK3 5Z9Q== 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=RlZtvJOSEkY8ly0FO5pqqs7Lu/5tCcAUE3SitFRssMxVnrdP12XYfByT02wtKYzExv ZpQRHAvIAuaeLTv8bQaXXulVqhs2n3VBUb26BnAUOM/vHZ/bgI3/xOjAoN3qRMCD5GD3 aHvGd/L0DQIFpC2rH0JP/TXS4TYOL34XasymjuGrE8PXtajNdhKKJYPp9i21mX5jQWx0 IeMwNCnp5n80S5rGhI0m1sdYj8Dk9tlweZSrjC+vMufEw5fSugR0m/mEUEvU4wAa5eT2 1OUFpmh60s0OPbMFdPscX14wybUWmaua/VsWEi026Brbyx0Gh2n5rQJMg8tJzYf+cbJc nj1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1BqDliUp; 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 be1-20020a656e41000000b0039908cc9e0csi11595369pgb.238.2022.04.06.05.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:48:20 -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=1BqDliUp; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BDDA125280; Wed, 6 Apr 2022 02:33:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1578444AbiDEXTh (ORCPT + 99 others); Tue, 5 Apr 2022 19:19:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349460AbiDEJtx (ORCPT ); Tue, 5 Apr 2022 05:49:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665101B4; Tue, 5 Apr 2022 02:46:16 -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 01E1761675; Tue, 5 Apr 2022 09:46:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 100DEC385A1; Tue, 5 Apr 2022 09:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151975; bh=qQXWyRu4TEliDafq6CKePkOIo5nPfDxb/EyW2btOqvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1BqDliUpjF72e2kMuLANLuuA3EpVE+gIozSsHHSdKv6q1PEGBbyIccfRCNcWxrR/j Up3DeMyo+htBoy4kfMmKdMVBO7tN1vU/imd8JDE6z3eAl7651tWeagXYS+n2dAABhY Z3rOqF0bmz0enEo4eXZBGXAhCL4LlseIKEhlfraQ= 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.15 608/913] dma-debug: fix return value of __setup handlers Date: Tue, 5 Apr 2022 09:27:50 +0200 Message-Id: <20220405070358.065784435@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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