Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345360

Re: [PATCH v18 0/9] Compile-time stack metadata validation

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v18 0/9] Compile-time stack metadata validation
Date 2016-02-28 18:10 +0100
Message-ID <r7d0Z-5MI-1@gated-at.bofh.it> (permalink)
References <r6d33-2h5-5@gated-at.bofh.it> <r73uG-6XB-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 28, 2016 at 07:57:29AM +0100, Ingo Molnar wrote:
> 
> Another thing I've noticed are _thousands_ of these warnings:
> 
> objtool: kernel/sched/core.o: preempt_schedule_irq()+0x20: function has unreachable instruction
> objtool: kernel/sched/core.o: preempt_schedule_irq()+0x27: function has unreachable instruction
> objtool: kernel/sched/core.o: preempt_schedule_irq()+0x2c: function has unreachable instruction
> objtool: kernel/sched/core.o: preempt_schedule_irq()+0x33: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_put_page_vector()+0x171: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_put_page_vector()+0x178: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_put_page_vector()+0x17d: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_put_page_vector()+0x184: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_get_direct_page_vector()+0xe2: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_get_direct_page_vector()+0xe9: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_get_direct_page_vector()+0xee: function has unreachable instruction
> objtool: net/ceph/pagevec.o: ceph_get_direct_page_vector()+0xf5: function has unreachable instruction
> objtool: net/ceph/pagevec.o: zero_user_segment()+0x120: function has unreachable instruction
> objtool: net/ceph/pagevec.o: zero_user_segment()+0x127: function has unreachable instruction
> objtool: net/ceph/pagevec.o: zero_user_segment()+0x12c: function has unreachable instruction
> objtool: net/ceph/pagevec.o: zero_user_segment()+0x133: function has unreachable instruction
> 
> that's on an x86-64 allyesconfig kernel, with objtool merged to tip:master, using 
> GCC 4.9.2:
> 
>   gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC) 

Those are caused by CONFIG_KASAN, CONFIG_UBSAN, and CONFIG_GCOV_KERNEL,
which can all add unreachable instructions.  Technically, an unreachable
instruction isn't really a problem, but objtool warns about it because
it often means there's something going on in the control flow which it
doesn't understand.

I guess we could make CONFIG_STACK_VALIDATION conflict with those
options, but I think that would disable it on allyesconfig.

I'll see if I can make objtool smarter so that it detects these special
cases of unreachable instructions and ignores them.

> Also, please prefix such warnings with the standard compiler prefix, something 
> like this:
> 
> 	kernel/sched/core.c: warning: objtool: preempt_schedule_irq()+0x20: function has unreachable instruction
> 
> so that scripts/tools monitoring new build warnings can pick them up 
> automatically?

Yeah, good idea.

--
Josh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v18 0/9] Compile-time stack metadata validation Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 3/9] x86/xen: Mark xen_cpuid() stack frame as non-standard Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 2/9] objtool: Add STACK_FRAME_NON_STANDARD macro Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 4/9] bpf: Mark __bpf_prog_run() stack frame as non-standard Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 1/9] objtool: Mark non-standard files and directories Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 5/9] sched: Mark __schedule() stack frame as non-standard Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  [PATCH v18 8/9] objtool: Add CONFIG_STACK_VALIDATION option Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-26 00:00 +0100
  Re: [PATCH v18 0/9] Compile-time stack metadata validation Ingo Molnar <mingo@kernel.org> - 2016-02-28 08:00 +0100
    Re: [PATCH v18 0/9] Compile-time stack metadata validation Josh Poimboeuf <jpoimboe@redhat.com> - 2016-02-28 18:10 +0100
  Re: [PATCH v18 0/9] Compile-time stack metadata validation Ingo Molnar <mingo@kernel.org> - 2016-02-28 08:00 +0100

csiph-web