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


Groups > linux.kernel > #1240205

Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan()

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan()
Date 2015-10-06 09:30 +0200
Message-ID <qguRd-7Jr-37@gated-at.bofh.it> (permalink)
References (1 earlier) <qgc7U-5TG-7@gated-at.bofh.it> <qgcrg-6gj-9@gated-at.bofh.it> <qgcrg-6gj-13@gated-at.bofh.it> <qggXT-4mO-3@gated-at.bofh.it> <qghhf-4Jy-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:

> On 10/05/2015 07:39 PM, Andi Kleen wrote:
> >> But, I think I have the solution.
> >> We could have some blacklist - list of function names which we should be ignored.
> >> In kasan_report() we could resolve return address to function name and compare it with name in list.
> >> If name in list -> ignore report.
> > 
> > I think annotating statements is cleaner than functions, even if it
> > is more code. Much better documentation
> > 
> 
> I agree with that, that's why I suggested to add READ_ONCE_NOCHECK():
> 	READ_ONCE_NOCHECK()
> 	{
> 		kasan_disable_current();
> 		READ_ONCE();
> 		kasan_enable_current();
> 	}
> 
> Anywone objects?

Sounds good to me! As long as it's hidden from plain .c files I'm a happy camper.

This should probably also be faster for KASAN than triggering a warning and having 
to parse a blacklist, right?

> > If disabling with an attribute doesn't work, you could put it into a special 
> > section with __attribute__((section ...)) and check the start/end symbol 
> > before reporting. That's how kprobes solves similar issues. It also has the 
> > advantage that it stops inlining.
> 
> Yes, it might be better. Although, because of broken -fconserve-stack, this may 
> not work in some cases - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533 
> Function splitter may split original function into two parts and it always puts 
> one split part in default .text section.

We do a _ton_ of such section tricks in the kernel (all of exception handling is 
based on that) - if that's broken by -fconserve-stack then the kernel is broken 
much more widely.

So unless KASAN wants to do something special here you can rely on sections just 
fine.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-05 12:40 +0200
  Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Borislav Petkov <bp@alien8.de> - 2015-10-05 13:20 +0200
  Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Ingo Molnar <mingo@kernel.org> - 2015-10-05 13:30 +0200
    Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Dmitry Vyukov <dvyukov@google.com> - 2015-10-05 13:50 +0200
      Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-05 13:50 +0200
        Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Borislav Petkov <bp@alien8.de> - 2015-10-05 15:20 +0200
          Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andy Lutomirski <luto@amacapital.net> - 2015-10-05 20:50 +0200
        Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andi Kleen <ak@linux.intel.com> - 2015-10-05 18:40 +0200
          Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-05 19:00 +0200
            Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andi Kleen <ak@linux.intel.com> - 2015-10-05 21:00 +0200
            Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Ingo Molnar <mingo@kernel.org> - 2015-10-06 09:30 +0200
              Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-06 09:40 +0200
              Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andy Lutomirski <luto@amacapital.net> - 2015-10-06 20:20 +0200
                Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Ingo Molnar <mingo@kernel.org> - 2015-10-07 09:30 +0200
                Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-07 11:00 +0200
                Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-10-07 11:20 +0200
                Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andi Kleen <ak@linux.intel.com> - 2015-10-07 18:30 +0200
                Re: [PATCH] x86/process: Silence KASAN warnings in get_wchan() Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-10-07 20:50 +0200

csiph-web