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: <b2faf615-b1cd-b3ec-502f-38fef11182a2@virtuozzo.com>
Date:   Tue, 23 Jan 2018 13:44:48 +0300
From:   Andrey Ryabinin <aryabinin@...tuozzo.com>
To:     Andrey Konovalov <andreyknvl@...gle.com>,
        Alexander Potapenko <glider@...gle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc:     Kostya Serebryany <kcc@...gle.com>,
        Evgeniy Stepanov <eugenis@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] kasan: add __asan_report_loadN/storeN_noabort callbacks

On 01/19/2018 08:44 PM, Andrey Konovalov wrote:
> Instead of __asan_report_load_n_noabort and __asan_report_store_n_noabort
> callbacks Clang emits differently named __asan_report_loadN_noabort and
> __asan_report_storeN_noabort (similar to __asan_loadN/storeN_noabort, whose
> names both GCC and Clang agree on).
> 
> Add callback implementation for __asan_report_loadN/storeN_noabort.
> 

This made me wonder why this wasn't observed before. So I noticed that
inline instrumentation with -fsanitize=kernel-addresss is broken in clang,
and clang never calls __asan_report*() functions. I see that you guys fixed this
just yesterday https://reviews.llvm.org/D42384 .

But it seems that you didn't fix the rest of "if (CompileKernel)" crap.
Clang generates "__asan_report_[load,store]N*" instead of "__asan_report_[load,store]_n*"
only because of this idiocy:

	const std::string SuffixStr = CompileKernel ? "N" : "_n";

See https://github.com/llvm-mirror/llvm/blob/ca19eaabd75f55865efd321b7a6f1d4ba3db8bc8/lib/Transforms/Instrumentation/AddressSanitizer.cpp#L2250

Note that SuffixStr is used *only* for __asan_report_* callbacks, which makes no sense because
we never ever had __asan_report* callbacks with "N" suffix.

So I think that you should just fix the llvm here.

And there is probably one more "if (CompileKernel)" crap in runOnModule()
which breaks globals instrumentation.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ