From mboxrd@z Thu Jan 1 00:00:00 1970 From: a.ryabinin@samsung.com (Andrey Ryabinin) Date: Tue, 26 May 2015 17:12:39 +0300 Subject: [PATCH v2 5/5] arm64: add KASan support In-Reply-To: References: <1431698344-28054-1-git-send-email-a.ryabinin@samsung.com> <1431698344-28054-6-git-send-email-a.ryabinin@samsung.com> Message-ID: <55647F57.8010008@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 05/26/2015 04:35 PM, Linus Walleij wrote: > On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > > And then at boot I just get this: > > kasan test: kmalloc_oob_right out-of-bounds to right > kasan test: kmalloc_oob_left out-of-bounds to left > kasan test: kmalloc_node_oob_right kmalloc_node(): out-of-bounds to right > kasan test: kmalloc_large_oob_rigth kmalloc large allocation: > out-of-bounds to right > kasan test: kmalloc_oob_krealloc_more out-of-bounds after krealloc more > kasan test: kmalloc_oob_krealloc_less out-of-bounds after krealloc less > kasan test: kmalloc_oob_16 kmalloc out-of-bounds for 16-bytes access > kasan test: kmalloc_oob_in_memset out-of-bounds in memset > kasan test: kmalloc_uaf use-after-free > kasan test: kmalloc_uaf_memset use-after-free in memset > kasan test: kmalloc_uaf2 use-after-free after another kmalloc > kasan test: kmem_cache_oob out-of-bounds in kmem_cache_alloc > kasan test: kasan_stack_oob out-of-bounds on stack > kasan test: kasan_global_oob out-of-bounds global variable > > W00t no nice KASan warnings (which is what I expect). > > This is my compiler by the way: > $ arm-linux-gnueabihf-gcc --version > arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - > Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) > > I did the same exercise on the foundation model (FVP) and I guess > that is what you developed the patch set on because there I got > nice KASan dumps: > That's not kasan dumps. That is slub debug output. KASan warnings starts with "BUG: KASan: use after free/out of bounds access " line. > I wonder were the problem lies, any hints where to start looking > to fix this? > I suspect that your compiler lack -fsantize=kernel-address support. It seems that GCC 4.9.2 doesn't supports -fsanitize=address/kernel-address on aarch64. I tested this patchset on Cavium Thunder-x and on FVP also and didn't observe any problems. > Yours, > Linus Walleij > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by kanga.kvack.org (Postfix) with ESMTP id 2E2146B0121 for ; Tue, 26 May 2015 10:12:47 -0400 (EDT) Received: by pdfh10 with SMTP id h10so91705609pdf.3 for ; Tue, 26 May 2015 07:12:46 -0700 (PDT) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com. [210.118.77.13]) by mx.google.com with ESMTPS id h13si21203821pdk.53.2015.05.26.07.12.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 May 2015 07:12:46 -0700 (PDT) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NOY00JTRNH5EH50@mailout3.w1.samsung.com> for linux-mm@kvack.org; Tue, 26 May 2015 15:12:41 +0100 (BST) Message-id: <55647F57.8010008@samsung.com> Date: Tue, 26 May 2015 17:12:39 +0300 From: Andrey Ryabinin MIME-version: 1.0 Subject: Re: [PATCH v2 5/5] arm64: add KASan support References: <1431698344-28054-1-git-send-email-a.ryabinin@samsung.com> <1431698344-28054-6-git-send-email-a.ryabinin@samsung.com> In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linus Walleij Cc: "linux-kernel@vger.kernel.org" , Dmitry Vyukov , Alexander Potapenko , David Keitel , Arnd Bergmann , Andrew Morton , Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" , linux-mm@kvack.org On 05/26/2015 04:35 PM, Linus Walleij wrote: > On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > > And then at boot I just get this: > > kasan test: kmalloc_oob_right out-of-bounds to right > kasan test: kmalloc_oob_left out-of-bounds to left > kasan test: kmalloc_node_oob_right kmalloc_node(): out-of-bounds to right > kasan test: kmalloc_large_oob_rigth kmalloc large allocation: > out-of-bounds to right > kasan test: kmalloc_oob_krealloc_more out-of-bounds after krealloc more > kasan test: kmalloc_oob_krealloc_less out-of-bounds after krealloc less > kasan test: kmalloc_oob_16 kmalloc out-of-bounds for 16-bytes access > kasan test: kmalloc_oob_in_memset out-of-bounds in memset > kasan test: kmalloc_uaf use-after-free > kasan test: kmalloc_uaf_memset use-after-free in memset > kasan test: kmalloc_uaf2 use-after-free after another kmalloc > kasan test: kmem_cache_oob out-of-bounds in kmem_cache_alloc > kasan test: kasan_stack_oob out-of-bounds on stack > kasan test: kasan_global_oob out-of-bounds global variable > > W00t no nice KASan warnings (which is what I expect). > > This is my compiler by the way: > $ arm-linux-gnueabihf-gcc --version > arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - > Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) > > I did the same exercise on the foundation model (FVP) and I guess > that is what you developed the patch set on because there I got > nice KASan dumps: > That's not kasan dumps. That is slub debug output. KASan warnings starts with "BUG: KASan: use after free/out of bounds access " line. > I wonder were the problem lies, any hints where to start looking > to fix this? > I suspect that your compiler lack -fsantize=kernel-address support. It seems that GCC 4.9.2 doesn't supports -fsanitize=address/kernel-address on aarch64. I tested this patchset on Cavium Thunder-x and on FVP also and didn't observe any problems. > Yours, > Linus Walleij > -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932278AbbEZOMu (ORCPT ); Tue, 26 May 2015 10:12:50 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:35353 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754979AbbEZOMo (ORCPT ); Tue, 26 May 2015 10:12:44 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-1a-55647f596367 Message-id: <55647F57.8010008@samsung.com> Date: Tue, 26 May 2015 17:12:39 +0300 From: Andrey Ryabinin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-version: 1.0 To: Linus Walleij Cc: "linux-kernel@vger.kernel.org" , Dmitry Vyukov , Alexander Potapenko , David Keitel , Arnd Bergmann , Andrew Morton , Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" , linux-mm@kvack.org Subject: Re: [PATCH v2 5/5] arm64: add KASan support References: <1431698344-28054-1-git-send-email-a.ryabinin@samsung.com> <1431698344-28054-6-git-send-email-a.ryabinin@samsung.com> In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e/4Nd3I+pRQg2lbZS3mrF/DZvF30jF2 i/fLehgtdl96xmwx4WEbu0X7x73MFlP+LGey2PT4GqvF5V1z2CzurfnPavHy4wkWB26PNfPW MHr8/jWJ0eNyXy+Tx4JNpR6bPk1i97hzbQ+bx4kZv1k8Ni+p9/i8SS6AM4rLJiU1J7MstUjf LoEro+PvCvaC9/wVN5YtYWpg7OHtYuTkkBAwkVj0aQoThC0mceHeerYuRi4OIYGljBJXVqxj gnC+M0osffKdHaSKV0BL4uXzB4wgNouAqkTfsa9g3WwCehL/Zm1nA7FFBSIk3l4+yQRRLyjx Y/I9FhBbREBHonvbT1aQocwCe5gldn7vZwVJCAOd8WT5EnaIbacYJVqfzwFLcAoES/w53gc0 iQOoQ11iypRckDCzgLzE5jVvmScwCsxCsmMWQtUsJFULGJlXMYqmliYXFCel5xrqFSfmFpfm pesl5+duYoTEzJcdjIuPWR1iFOBgVOLhtTicHCrEmlhWXJl7iFGCg1lJhHdxdUqoEG9KYmVV alF+fFFpTmrxIUZpDhYlcd65u96HCAmkJ5akZqemFqQWwWSZODilGhhTn+sl7Z79zLk3cCW/ /yvJT2/9DJPvlqSwH201uH7uvrXs991PWL8a1sz6YP0ux3qByq/5daK7k9au4bnAp++26cPB mRH21fef+OzjfbCYZYVoX3fv3H1a3+/tmPQ+zMNUKq0gee4xicBEs5f/WhjFfe/JPzcOWXX8 fWPDL++l68/xR/FLPjdRYinOSDTUYi4qTgQA/3Km55UCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/26/2015 04:35 PM, Linus Walleij wrote: > On Fri, May 15, 2015 at 3:59 PM, Andrey Ryabinin wrote: > > And then at boot I just get this: > > kasan test: kmalloc_oob_right out-of-bounds to right > kasan test: kmalloc_oob_left out-of-bounds to left > kasan test: kmalloc_node_oob_right kmalloc_node(): out-of-bounds to right > kasan test: kmalloc_large_oob_rigth kmalloc large allocation: > out-of-bounds to right > kasan test: kmalloc_oob_krealloc_more out-of-bounds after krealloc more > kasan test: kmalloc_oob_krealloc_less out-of-bounds after krealloc less > kasan test: kmalloc_oob_16 kmalloc out-of-bounds for 16-bytes access > kasan test: kmalloc_oob_in_memset out-of-bounds in memset > kasan test: kmalloc_uaf use-after-free > kasan test: kmalloc_uaf_memset use-after-free in memset > kasan test: kmalloc_uaf2 use-after-free after another kmalloc > kasan test: kmem_cache_oob out-of-bounds in kmem_cache_alloc > kasan test: kasan_stack_oob out-of-bounds on stack > kasan test: kasan_global_oob out-of-bounds global variable > > W00t no nice KASan warnings (which is what I expect). > > This is my compiler by the way: > $ arm-linux-gnueabihf-gcc --version > arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - > Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) > > I did the same exercise on the foundation model (FVP) and I guess > that is what you developed the patch set on because there I got > nice KASan dumps: > That's not kasan dumps. That is slub debug output. KASan warnings starts with "BUG: KASan: use after free/out of bounds access " line. > I wonder were the problem lies, any hints where to start looking > to fix this? > I suspect that your compiler lack -fsantize=kernel-address support. It seems that GCC 4.9.2 doesn't supports -fsanitize=address/kernel-address on aarch64. I tested this patchset on Cavium Thunder-x and on FVP also and didn't observe any problems. > Yours, > Linus Walleij >