From nobody Tue Jun 23 18:19:59 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7840DC433EF for ; Mon, 28 Feb 2022 22:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbiB1WFm (ORCPT ); Mon, 28 Feb 2022 17:05:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiB1WFj (ORCPT ); Mon, 28 Feb 2022 17:05:39 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F70C4B55 for ; Mon, 28 Feb 2022 14:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=mmm+PW+NtNM5o6/cJBgUmQCsMyjF6xFQu4DaDU5Rl54=; b=PHwapDxrfaF56tA9Lag8PmfkBV FFJIDTvG6qC0Ik1grXkkfvHixsQ5zdbdu+gK1aLB9BHhrfDuIK6Pvpr9uJ5Ya8cu+qzfxBjhggAVb Vt3F28dwYNdx/4rXtYFScArR33X05bkdgtVkt5PAJikCBYrs7ehnC1DuYuBEXSEu3W4P3Q5l6dS5s l0If5FoHoNXyA3ZaXsXi2loUiSXbnOcB3KHdD873KAHK0HyYROXG8qg9J0MIliRFkYhVB2c/LaXUd ZWSWLvZCPlf3Z7F1PswoZi6vj8lEpsReK10GCtHR4iL1PchWIF79mKcbaAl86wN9ZumKFUFZy6ZWG TDc9qRAQ==; Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOo8W-00EFxg-2B; Mon, 28 Feb 2022 22:04:56 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Igor Zhbanov , Joerg Roedel , Christoph Hellwig , Marek Szyprowski , iommu@lists.linux-foundation.org, Robin Murphy Subject: [PATCH] kernel: dma-debug: fix return value of __setup handlers Date: Mon, 28 Feb 2022 14:04:53 -0800 Message-Id: <20220228220453.23726-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When valid kernel command line parameters dma_debug=3Doff dma_debug_entries=3D100 are used, they are reported as Unknown parameters and added to init's environment strings, polluting it. Unknown kernel command line parameters "BOOT_IMAGE=3D/boot/bzImage-517rc5 dma_debug=3Doff dma_debug_entries=3D100", will be passed to user space. and Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=3D/ TERM=3Dlinux BOOT_IMAGE=3D/boot/bzImage-517rc5 dma_debug=3Doff dma_debug_entries=3D100 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 --- kernel/dma/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- linux-next-20220228.orig/kernel/dma/debug.c +++ linux-next-20220228/kernel/dma/debug.c @@ -927,7 +927,7 @@ static __init int dma_debug_cmdline(char global_disable =3D true; } =20 - return 0; + return 1; } =20 static __init int dma_debug_entries_cmdline(char *str) @@ -936,7 +936,7 @@ static __init int dma_debug_entries_cmdl return -EINVAL; if (!get_option(&str, &nr_prealloc_entries)) nr_prealloc_entries =3D PREALLOC_DMA_DEBUG_ENTRIES; - return 0; + return 1; } =20 __setup("dma_debug=3D", dma_debug_cmdline);