lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151016100021.GR3816@twins.programming.kicks-ass.net>
Date:	Fri, 16 Oct 2015 12:00:21 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andy Lutomirski <luto@...capital.net>,
	Andrey Konovalov <andreyknvl@...gle.com>,
	Kostya Serebryany <kcc@...gle.com>,
	Alexander Potapenko <glider@...gle.com>,
	kasan-dev <kasan-dev@...glegroups.com>,
	Borislav Petkov <bp@...en8.de>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Andi Kleen <ak@...ux.intel.com>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	Wolfram Gloger <wmglo@...t.med.uni-muenchen.de>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH v4 1/2] compiler, atomics: Provide READ_ONCE_NOKSAN()

On Fri, Oct 16, 2015 at 12:44:53PM +0300, Andrey Ryabinin wrote:
> Some code may perform racy by design memory reads. This could be
> harmless, yet such code may produce KASAN warnings.
> 
> To hide such accesses from KASAN this patch introduces
> READ_ONCE_NOKSAN() macro. KASAN will not check the memory
> accessed by READ_ONCE_NOKSAN(). The KernelThreadSanitizer (KTSAN)
> is going to ignore it as well.
> 
> This patch creates __read_once_size_noksan() a clone of
> __read_once_size(). The only difference between them is
> 'no_sanitized_address' attribute appended to '*_nokasan' function.
> This attribute tells the compiler that instrumentation of memory
> accesses should not be applied to that function. We declare it as
> static '__maybe_unsed' because GCC is not capable to inline such
> function: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
> 
> With KASAN=n READ_ONCE_NOKSAN() is just a clone of READ_ONCE().

Would we need a similar annotation for things like
mutex_spin_on_owner()'s dereference of owner, or is that considered safe
by KASAN?

(its not actually safe; as I remember we have a problem with using
rcu_read_lock for tasks like that)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ