All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Stephen Boyd <swboyd@chromium.org>,
	iommu@lists.linux-foundation.org,
	Semmle Security Reports <security-reports@semmle.com>,
	kbuild-all@01.org, Jesper Dangaard Brouer <brouer@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Laura Abbott <labbott@redhat.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>,
	Allison Randal <allison@lohutok.net>
Subject: Re: [PATCH v2] dma-mapping: Move vmap address checks into dma_map_single()
Date: Sat, 5 Oct 2019 22:53:54 +0800	[thread overview]
Message-ID: <201910052236.X97C7dDP%lkp@intel.com> (raw)
In-Reply-To: <201910041420.F6E55D29A@keescook>

[-- Attachment #1: Type: text/plain, Size: 8792 bytes --]

Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Kees-Cook/dma-mapping-Move-vmap-address-checks-into-dma_map_single/20191005-073954
config: i386-randconfig-d001-201939 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/init.h:5:0,
                    from sound/pci/ad1889.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
--
   In file included from include/linux/export.h:44:0,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/delay.h:22,
                    from sound/pci//hda/hda_intel.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   In file included from sound/pci//hda/hda_intel_trace.h:54:0,
                    from sound/pci//hda/hda_intel.c:58:
   include/trace/define_trace.h: At top level:
   include/trace/define_trace.h:95:42: fatal error: ./hda_intel_trace.h: No such file or directory
    #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                             ^
   compilation terminated.

vim +/if +587 include/linux/dma-mapping.h

   582	
   583	static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
   584			size_t size, enum dma_data_direction dir, unsigned long attrs)
   585	{
   586		/* DMA must never operate on areas that might be remapped. */
 > 587		if (WARN_ONCE(is_vmalloc_addr(ptr),
 > 588			      "%s %s: driver maps %lu bytes from vmalloc area\n",
   589			      dev ? dev_driver_string(dev) : "unknown driver",
   590			      dev ? dev_name(dev) : "unknown device", size))
   591			return DMA_MAPPING_ERROR;
   592	
   593		debug_dma_map_single(dev, ptr, size);
   594		return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr),
   595				size, dir, attrs);
   596	}
   597	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33925 bytes --]

[-- Attachment #3: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2] dma-mapping: Move vmap address checks into dma_map_single()
Date: Sat, 05 Oct 2019 22:53:54 +0800	[thread overview]
Message-ID: <201910052236.X97C7dDP%lkp@intel.com> (raw)
In-Reply-To: <201910041420.F6E55D29A@keescook>

[-- Attachment #1: Type: text/plain, Size: 8968 bytes --]

Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Kees-Cook/dma-mapping-Move-vmap-address-checks-into-dma_map_single/20191005-073954
config: i386-randconfig-d001-201939 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/init.h:5:0,
                    from sound/pci/ad1889.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
--
   In file included from include/linux/export.h:44:0,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/delay.h:22,
                    from sound/pci//hda/hda_intel.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   In file included from sound/pci//hda/hda_intel_trace.h:54:0,
                    from sound/pci//hda/hda_intel.c:58:
   include/trace/define_trace.h: At top level:
   include/trace/define_trace.h:95:42: fatal error: ./hda_intel_trace.h: No such file or directory
    #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                             ^
   compilation terminated.

vim +/if +587 include/linux/dma-mapping.h

   582	
   583	static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
   584			size_t size, enum dma_data_direction dir, unsigned long attrs)
   585	{
   586		/* DMA must never operate on areas that might be remapped. */
 > 587		if (WARN_ONCE(is_vmalloc_addr(ptr),
 > 588			      "%s %s: driver maps %lu bytes from vmalloc area\n",
   589			      dev ? dev_driver_string(dev) : "unknown driver",
   590			      dev ? dev_name(dev) : "unknown device", size))
   591			return DMA_MAPPING_ERROR;
   592	
   593		debug_dma_map_single(dev, ptr, size);
   594		return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr),
   595				size, dir, attrs);
   596	}
   597	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33925 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: kbuild-all@01.org, Robin Murphy <robin.murphy@arm.com>,
	Laura Abbott <labbott@redhat.com>,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Allison Randal <allison@lohutok.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <swboyd@chromium.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Semmle Security Reports <security-reports@semmle.com>,
	iommu@lists.linux-foundation.org
Subject: Re: [PATCH v2] dma-mapping: Move vmap address checks into dma_map_single()
Date: Sat, 5 Oct 2019 22:53:54 +0800	[thread overview]
Message-ID: <201910052236.X97C7dDP%lkp@intel.com> (raw)
In-Reply-To: <201910041420.F6E55D29A@keescook>

[-- Attachment #1: Type: text/plain, Size: 8792 bytes --]

Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc1 next-20191004]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Kees-Cook/dma-mapping-Move-vmap-address-checks-into-dma_map_single/20191005-073954
config: i386-randconfig-d001-201939 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/init.h:5:0,
                    from sound/pci/ad1889.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
--
   In file included from include/linux/export.h:44:0,
                    from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/delay.h:22,
                    from sound/pci//hda/hda_intel.c:23:
   include/linux/dma-mapping.h: In function 'dma_map_single_attrs':
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   include/linux/dma-mapping.h:588:9: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
            "%s %s: driver maps %lu bytes from vmalloc area\n",
            ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> include/linux/dma-mapping.h:587:2: note: in expansion of macro 'if'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
     ^~
   include/asm-generic/bug.h:124:3: note: in expansion of macro '__WARN_printf'
      __WARN_printf(TAINT_WARN, format);   \
      ^~~~~~~~~~~~~
   include/asm-generic/bug.h:155:3: note: in expansion of macro 'WARN'
      WARN(1, format);    \
      ^~~~
   include/linux/dma-mapping.h:587:6: note: in expansion of macro 'WARN_ONCE'
     if (WARN_ONCE(is_vmalloc_addr(ptr),
         ^~~~~~~~~
   In file included from sound/pci//hda/hda_intel_trace.h:54:0,
                    from sound/pci//hda/hda_intel.c:58:
   include/trace/define_trace.h: At top level:
   include/trace/define_trace.h:95:42: fatal error: ./hda_intel_trace.h: No such file or directory
    #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                             ^
   compilation terminated.

vim +/if +587 include/linux/dma-mapping.h

   582	
   583	static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
   584			size_t size, enum dma_data_direction dir, unsigned long attrs)
   585	{
   586		/* DMA must never operate on areas that might be remapped. */
 > 587		if (WARN_ONCE(is_vmalloc_addr(ptr),
 > 588			      "%s %s: driver maps %lu bytes from vmalloc area\n",
   589			      dev ? dev_driver_string(dev) : "unknown driver",
   590			      dev ? dev_name(dev) : "unknown device", size))
   591			return DMA_MAPPING_ERROR;
   592	
   593		debug_dma_map_single(dev, ptr, size);
   594		return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr),
   595				size, dir, attrs);
   596	}
   597	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33925 bytes --]

  parent reply	other threads:[~2019-10-05 14:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 21:28 [PATCH v2] dma-mapping: Move vmap address checks into dma_map_single() Kees Cook
2019-10-04 21:28 ` Kees Cook
2019-10-04 21:38 ` Florian Fainelli
2019-10-04 21:38   ` Florian Fainelli
2019-10-05  7:26 ` Greg Kroah-Hartman
2019-10-05  7:26   ` Greg Kroah-Hartman
2019-10-05  8:40 ` Christoph Hellwig
2019-10-05  8:40   ` Christoph Hellwig
2019-10-05 14:53 ` kbuild test robot [this message]
2019-10-05 14:53   ` kbuild test robot
2019-10-05 14:53   ` kbuild test robot
2019-10-11  7:20 ` kbuild test robot
2019-10-11  7:20   ` kbuild test robot
2019-10-11  7:20   ` kbuild test robot

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=201910052236.X97C7dDP%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=allison@lohutok.net \
    --cc=brouer@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=security-reports@semmle.com \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.