History

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

Linus Torvalds committed 2 years ago

Commit 17e232b2 parents 77c9622 7c65aa32 files · +5 −1Browse files

Unified · Split

2 files
  1. kernel/dma/debug.c +2 −1
  2. kernel/dma/swiotlb.c +3 −0
kernel/dma/debug.c+2−1
@@ -62,7 +62,8 @@ enum map_err_types { · 61 unmodified lines
6262 * @pfn: page frame of the start address
6363 * @offset: offset of mapping relative to pfn
6464 * @map_err_type: track whether dma_mapping_error() was checked
65− * @stacktrace: support backtraces when a violation is detected
65+ * @stack_len: number of backtrace entries in @stack_entries
66+ * @stack_entries: stack of backtrace history
6667 */
6768 struct dma_debug_entry {
6869 struct list_head list;
kernel/dma/swiotlb.c+3−0
@@ -1136,6 +1136,9 @@ static int swiotlb_find_slots(struct device *dev, phys_addr_t orig_addr, · 1135 unmodified lines
11361136 int cpu, i;
11371137 int index;
11381138
1139+ if (alloc_size > IO_TLB_SEGSIZE * IO_TLB_SIZE)
1140+ return -1;
1141+
11391142 cpu = raw_smp_processor_id();
11401143 for (i = 0; i < default_nareas; ++i) {
11411144 index = swiotlb_search_area(dev, cpu, i, orig_addr, alloc_size,