linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 11691/11963] mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace'
@ 2016-03-11 10:38 kbuild test robot
  2016-03-11 20:19 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2016-03-11 10:38 UTC (permalink / raw)
  To: Alexander Potapenko
  Cc: kbuild-all, Andrew Morton, Linux Memory Management List

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bb17bf337db5c5af7e75ec5916772c9bffcaf981
commit: d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3 [11691/11963] mm, kasan: stackdepot implementation. Enable stackdepot for SLAB
config: x86_64-randconfig-v0-03111742 (attached as .config)
reproduce:
        git checkout d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   mm/kasan/kasan.c: In function 'filter_irq_stacks':
>> mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace'
     if (!trace->nr_entries)
               ^
   mm/kasan/kasan.c: In function 'save_stack':
>> mm/kasan/kasan.c:442:9: error: variable 'trace' has initializer but incomplete type
     struct stack_trace trace = {
            ^
>> mm/kasan/kasan.c:443:3: error: unknown field 'nr_entries' specified in initializer
      .nr_entries = 0,
      ^
>> mm/kasan/kasan.c:443:17: warning: excess elements in struct initializer
      .nr_entries = 0,
                    ^
   mm/kasan/kasan.c:443:17: note: (near initialization for 'trace')
>> mm/kasan/kasan.c:444:3: error: unknown field 'entries' specified in initializer
      .entries = entries,
      ^
   mm/kasan/kasan.c:444:14: warning: excess elements in struct initializer
      .entries = entries,
                 ^
   mm/kasan/kasan.c:444:14: note: (near initialization for 'trace')
>> mm/kasan/kasan.c:445:3: error: unknown field 'max_entries' specified in initializer
      .max_entries = KASAN_STACK_DEPTH,
      ^
   In file included from mm/kasan/kasan.c:38:0:
>> mm/kasan/kasan.h:68:27: warning: excess elements in struct initializer
    #define KASAN_STACK_DEPTH 64
                              ^
>> mm/kasan/kasan.c:445:18: note: in expansion of macro 'KASAN_STACK_DEPTH'
      .max_entries = KASAN_STACK_DEPTH,
                     ^
   mm/kasan/kasan.h:68:27: note: (near initialization for 'trace')
    #define KASAN_STACK_DEPTH 64
                              ^
>> mm/kasan/kasan.c:445:18: note: in expansion of macro 'KASAN_STACK_DEPTH'
      .max_entries = KASAN_STACK_DEPTH,
                     ^
>> mm/kasan/kasan.c:446:3: error: unknown field 'skip' specified in initializer
      .skip = 0
      ^
   mm/kasan/kasan.c:446:11: warning: excess elements in struct initializer
      .skip = 0
              ^
   mm/kasan/kasan.c:446:11: note: (near initialization for 'trace')
>> mm/kasan/kasan.c:442:21: error: storage size of 'trace' isn't known
     struct stack_trace trace = {
                        ^
>> mm/kasan/kasan.c:442:21: warning: unused variable 'trace' [-Wunused-variable]

vim +429 mm/kasan/kasan.c

   423	}
   424	
   425	static inline void filter_irq_stacks(struct stack_trace *trace)
   426	{
   427		int i;
   428	
 > 429		if (!trace->nr_entries)
   430			return;
   431		for (i = 0; i < trace->nr_entries; i++)
   432			if (in_irqentry_text(trace->entries[i])) {
   433				/* Include the irqentry function into the stack. */
   434				trace->nr_entries = i + 1;
   435				break;
   436			}
   437	}
   438	
   439	static inline depot_stack_handle save_stack(gfp_t flags)
   440	{
   441		unsigned long entries[KASAN_STACK_DEPTH];
 > 442		struct stack_trace trace = {
 > 443			.nr_entries = 0,
 > 444			.entries = entries,
 > 445			.max_entries = KASAN_STACK_DEPTH,
 > 446			.skip = 0
   447		};
   448	
   449		save_stack_trace(&trace);

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24265 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 11691/11963] mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace'
  2016-03-11 10:38 [linux-next:master 11691/11963] mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace' kbuild test robot
@ 2016-03-11 20:19 ` Andrew Morton
  2016-03-11 20:26   ` Alexander Potapenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2016-03-11 20:19 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Alexander Potapenko, kbuild-all, Linux Memory Management List

On Fri, 11 Mar 2016 18:38:47 +0800 kbuild test robot <fengguang.wu@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   bb17bf337db5c5af7e75ec5916772c9bffcaf981
> commit: d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3 [11691/11963] mm, kasan: stackdepot implementation. Enable stackdepot for SLAB
> config: x86_64-randconfig-v0-03111742 (attached as .config)
> reproduce:
>         git checkout d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    mm/kasan/kasan.c: In function 'filter_irq_stacks':
> >> mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace'
>      if (!trace->nr_entries)

Yeah, that's a bit screwed up.  The code needs CONFIG_STACKTRACE but this:

--- a/lib/Kconfig.kasan~mm-kasan-stackdepot-implementation-enable-stackdepot-for-slab-fix-fix
+++ a/lib/Kconfig.kasan
@@ -8,6 +8,7 @@ config KASAN
 	depends on SLUB_DEBUG || (SLAB && !DEBUG_SLAB)
 	select CONSTRUCTORS
 	select STACKDEPOT if SLAB
+	select STACKTRACE if SLAB
 	help
 	  Enables kernel address sanitizer - runtime memory debugger,
 	  designed to find out-of-bounds accesses and use-after-free bugs.

doesn't work because CONFIG_SLAB=n.  And I don't think we want to
enable all this extra stuff for slub/slob/etc.

Over to you, Alexander.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 11691/11963] mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace'
  2016-03-11 20:19 ` Andrew Morton
@ 2016-03-11 20:26   ` Alexander Potapenko
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Potapenko @ 2016-03-11 20:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Memory Management List, kbuild-all, kbuild test robot

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

On Mar 11, 2016 9:19 PM, "Andrew Morton" <akpm@linux-foundation.org> wrote:
>
> On Fri, 11 Mar 2016 18:38:47 +0800 kbuild test robot <
fengguang.wu@intel.com> wrote:
>
> > tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   bb17bf337db5c5af7e75ec5916772c9bffcaf981
> > commit: d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3 [11691/11963] mm,
kasan: stackdepot implementation. Enable stackdepot for SLAB
> > config: x86_64-randconfig-v0-03111742 (attached as .config)
> > reproduce:
> >         git checkout d5e0cb037c3f7a9cc54b9427e0281c7877d62ff3
> >         # save the attached .config to linux build tree
> >         make ARCH=x86_64
> >
> > All error/warnings (new ones prefixed by >>):
> >
> >    mm/kasan/kasan.c: In function 'filter_irq_stacks':
> > >> mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete
type 'struct stack_trace'
> >      if (!trace->nr_entries)
>
> Yeah, that's a bit screwed up.  The code needs CONFIG_STACKTRACE but this:
>
> ---
a/lib/Kconfig.kasan~mm-kasan-stackdepot-implementation-enable-stackdepot-for-slab-fix-fix
> +++ a/lib/Kconfig.kasan
> @@ -8,6 +8,7 @@ config KASAN
>         depends on SLUB_DEBUG || (SLAB && !DEBUG_SLAB)
>         select CONSTRUCTORS
>         select STACKDEPOT if SLAB
> +       select STACKTRACE if SLAB
>         help
>           Enables kernel address sanitizer - runtime memory debugger,
>           designed to find out-of-bounds accesses and use-after-free bugs.
>
> doesn't work because CONFIG_SLAB=n.  And I don't think we want to
> enable all this extra stuff for slub/slob/etc.
>
> Over to you, Alexander.
Um, perhaps the code in question should be SLAB-only. I'll send the fix on
Monday.

[-- Attachment #2: Type: text/html, Size: 2373 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-11 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11 10:38 [linux-next:master 11691/11963] mm/kasan/kasan.c:429:12: error: dereferencing pointer to incomplete type 'struct stack_trace' kbuild test robot
2016-03-11 20:19 ` Andrew Morton
2016-03-11 20:26   ` Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).