]> Git Repo - J-linux.git/commitdiff
Merge tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping
authorLinus Torvalds <[email protected]>
Fri, 19 Jan 2024 00:49:34 +0000 (16:49 -0800)
committerLinus Torvalds <[email protected]>
Fri, 19 Jan 2024 00:49:34 +0000 (16:49 -0800)
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

1  2 
kernel/dma/debug.c
kernel/dma/swiotlb.c

diff --combined kernel/dma/debug.c
index 1a5c86dd87d598c02e08fa011a08472e8b98b8e0,08b7f84b76f9e0627f9bfd64858d8cc55ba2c459..a6e3792b15f8a5ce0f870901de50b53a356df829
@@@ -62,7 -62,8 +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;
@@@ -876,7 -877,7 +877,7 @@@ static int dma_debug_device_change(stru
        return 0;
  }
  
 -void dma_debug_add_bus(struct bus_type *bus)
 +void dma_debug_add_bus(const struct bus_type *bus)
  {
        struct notifier_block *nb;
  
diff --combined kernel/dma/swiotlb.c
index 97c298b210bc71d75eac5ce0dee78ae39f44a746,96f832d828fd4691f178575558ec40d9094baf82..b079a9a8e08795b40fb0cc3891a68bcb90922876
@@@ -686,8 -686,8 +686,8 @@@ static struct io_tlb_pool *swiotlb_allo
        size_t pool_size;
        size_t tlb_size;
  
 -      if (nslabs > SLABS_PER_PAGE << MAX_ORDER) {
 -              nslabs = SLABS_PER_PAGE << MAX_ORDER;
 +      if (nslabs > SLABS_PER_PAGE << MAX_PAGE_ORDER) {
 +              nslabs = SLABS_PER_PAGE << MAX_PAGE_ORDER;
                nareas = limit_nareas(nareas, nslabs);
        }
  
@@@ -1136,6 -1136,9 +1136,9 @@@ static int swiotlb_find_slots(struct de
        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,
This page took 0.055979 seconds and 4 git commands to generate.