From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728595AbgFJM2V (ORCPT ); Wed, 10 Jun 2020 08:28:21 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CBAC03E96F for ; Wed, 10 Jun 2020 05:28:21 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id z1so1541047qtn.2 for ; Wed, 10 Jun 2020 05:28:21 -0700 (PDT) Date: Wed, 10 Jun 2020 08:28:17 -0400 From: Qian Cai Subject: Re: [PATCH] mm/page_alloc: silence a KASAN false positive Message-ID: <20200610122817.GC954@lca.pw> References: <20200610052154.5180-1-cai@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-s390-owner@vger.kernel.org List-ID: To: Alexander Potapenko Cc: Dmitry Vyukov , Andrew Morton , Christian Borntraeger , Kees Cook , kasan-dev , Linux-MM , linux-s390 , LKML , Heiko Carstens , Vasily Gorbik On Wed, Jun 10, 2020 at 01:02:04PM +0200, Alexander Potapenko wrote: > On Wed, Jun 10, 2020 at 7:55 AM Dmitry Vyukov wrote: > > > > On Wed, Jun 10, 2020 at 7:22 AM Qian Cai wrote: > > > > > > kernel_init_free_pages() will use memset() on s390 to clear all pages > > > from kmalloc_order() which will override KASAN redzones because a > > > redzone was setup from the end of the allocation size to the end of the > > > last page. Silence it by not reporting it there. An example of the > > > report is, > > > > Interesting. The reason why we did not hit it on x86_64 is because > > clear_page is implemented in asm (arch/x86/lib/clear_page_64.S) and > > thus is not instrumented. Arm64 probably does the same. However, on > > s390 clear_page is defined to memset. > > Can we define it to __memset() instead? > __memset() is supposed to be ignored by KASAN, e.g. KASAN runtime uses > it in the places where we don't care about bugs. I suppose that could work if s390 maintains perfer this way.