]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
dma-debug: fix return value of __setup handlers
authorRandy Dunlap <rdunlap@infradead.org>
Mon, 28 Feb 2022 22:04:53 +0000 (14:04 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:24 +0000 (14:39 +0200)
commitd928c68ef6e3399e04bf0dbc7bb059db10e0af10
tree43badfbb640f1e864cb78231015df19d6672acb4
parentc60b71b701220156ee004aca1c9c7966585c40e8
dma-debug: fix return value of __setup handlers

BugLink: https://bugs.launchpad.net/bugs/1969110
[ 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 <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: iommu@lists.linux-foundation.org
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit c39a750b61f7b3a37243461f066b969ed27d1094)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
kernel/dma/debug.c