summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-01-19 01:49:34 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2024-01-19 01:49:34 +0100
commit17e232b6d2feddd0285e59dbe641c0efe67a5ee6 (patch)
tree598584ca5d9aa5a86f4cfea1a0363c1af8d07de5 /kernel
parentMerge tag 'memblock-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
parentdma-debug: fix kernel-doc warnings (diff)
downloadlinux-17e232b6d2feddd0285e59dbe641c0efe67a5ee6.tar.xz
linux-17e232b6d2feddd0285e59dbe641c0efe67a5ee6.zip
Merge tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fixes from Christoph Hellwig: - fix kerneldoc warnings (Randy Dunlap) - better bounds checking in swiotlb (ZhangPeng) * tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping: dma-debug: fix kernel-doc warnings swiotlb: check alloc_size before the allocation of a new memory pool
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma/debug.c3
-rw-r--r--kernel/dma/swiotlb.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 1a5c86dd87d5..a6e3792b15f8 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -62,7 +62,8 @@ enum map_err_types {
* @pfn: page frame of the start address
* @offset: offset of mapping relative to pfn
* @map_err_type: track whether dma_mapping_error() was checked
- * @stacktrace: support backtraces when a violation is detected
+ * @stack_len: number of backtrace entries in @stack_entries
+ * @stack_entries: stack of backtrace history
*/
struct dma_debug_entry {
struct list_head list;
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 97c298b210bc..b079a9a8e087 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -1136,6 +1136,9 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr,
int cpu, i;
int index;
+ if (alloc_size > IO_TLB_SEGSIZE * IO_TLB_SIZE)
+ return -1;
+
cpu = raw_smp_processor_id();
for (i = 0; i < default_nareas; ++i) {
index = swiotlb_search_area(dev, cpu, i, orig_addr, alloc_size,