From: Avi Weiss <thnkslprpt@gmail.com>
To: m.szyprowski@samsung.com, robin.murphy@arm.com
Cc: ailiop@suse.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org, x86@kernel.org,
Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH v2 0/2] dma-debug: Avoid uninitialized mapping dumps
Date: Thu, 19 Nov 2026 15:13:23 +0200 [thread overview]
Message-ID: <cover.1795093513.git.thnkslprpt@gmail.com> (raw)
Booting with dma_debug=off leaves the DMA-debug hash buckets
uninitialized, but the debugfs mapping dump is still registered.
Reading dma-api/dump then traverses an uninitialized list and
causes a NULL pointer dereference in dump_show().
Patch 1 skips debugfs registration when DMA debugging was not
initialized. Patch 2 removes the obsolete debug_dma_dump_mappings()
helper and its only caller in the legacy AMD GART IOMMU code.
Validation on x86-64 QEMU:
- baseline with dma_debug=off - NULL dereference in dump_show()
- patched with dma_debug=off - dma-api debugfs directory absent
- patched with DMA debugging enabled - mapping dump readable
- both objects compiled successfully with W=1
Changes since v1:
- guard debugfs registration instead of the dump paths, as
suggested by Anthony Iliopoulos
- remove the obsolete mapping dump helper and its AMD GART
caller (due to feedback from Robin Murphy and Marek Szyprowski)
v1 discussion:
https://lore-kernel.gnuweeb.org/linux-iommu/05c05ec4-b321-49d4-acf7-b9fa4223dba9%40samsung.com/T/
Avi Weiss (2):
dma-debug: Skip debugfs registration when uninitialized
dma-debug: Remove obsolete mapping dump helper
arch/x86/kernel/amd_gart_64.c | 1 -
include/linux/dma-map-ops.h | 4 ----
kernel/dma/debug.c | 40 ++++++-----------------------------
3 files changed, 6 insertions(+), 39 deletions(-)
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
--
2.43.0
next reply other threads:[~2026-11-19 13:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 13:13 Avi Weiss [this message]
2026-11-19 13:13 ` [PATCH v2 1/2] dma-debug: Skip debugfs registration when uninitialized Avi Weiss
2026-11-19 13:13 ` [PATCH v2 2/2] dma-debug: Remove obsolete mapping dump helper Avi Weiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1795093513.git.thnkslprpt@gmail.com \
--to=thnkslprpt@gmail.com \
--cc=ailiop@suse.com \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox