Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp463811ybg; Wed, 10 Jun 2020 05:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5I5A5UxlExSdJrpD4QfgKQ4CYmUVBiPWjdCsMc9nwBZ9DRJVdRbQhPDO7mlBNuq0Cxe7r X-Received: by 2002:a17:906:e247:: with SMTP id gq7mr3052440ejb.107.1591792422058; Wed, 10 Jun 2020 05:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591792422; cv=none; d=google.com; s=arc-20160816; b=Ex5rk9Mf8QORbzCk39sEVMyrXtOs+XJWhzL09I69LIAUW4p6LK3CBcGpQqLOTFFoAn TUy7Vsle0VEycSmi1s7QzvtrDc+NsC2dnxRPZqwgrCPwWnEXRm3b+tXxzk8yD9QmiBhX 0lFuZmwh/cZG2Hh0WMjpxsUDG0fxomjIXlP35NSxM91u3+D1PizNn2rk7CqL1FnUMd/B 1//X4DLS80a69WY+ig+cKIORr3ofojNC+DaQWLcPJxk1JIrUhi7bXT8oUgnEt3helCCP hlZlm3B/ZGaiUqG7BBpCvixQf+5pfactEZab2MKCiJCAsDmt9SqVkXGo7aDDODJUjxLN nCJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+g/QNFEcpPiOwSyTtWV6UhK4FMdUVFtGGz85G+f+/28=; b=vlQqAScQMp33u0R3dj/+OR8/5h1k4eGY+GNz7EVor3OlHJNqeVhyxQ+wVAtGgFP3vM zzOJtsliNG4312sEfhgfurb6RvQ7qM58QhIBBVvqBt6SZxT4OwmDlW/v77OW8JguAE18 yXi6TyPQ5pbmTIW4zP43F1WT25KCa4ABdq3OodyCCdzu948hG92/iwbFoVuwAeP+VDkP BLq/O5IRmPNE3OaUbfZ+WXvenjz/9y0cvyg0ljZ1nMrac4E0sDspIjLOP5jxjxRv/Wrz fpAwp1bzT1bS5I/eB+eQnPztHgjj3sqF/p6ybXvCnfo8/ndW+FEydgeTXlmNOugD/Ptf jttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=rhC0j4t2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si1356309eju.544.2020.06.10.05.33.19; Wed, 10 Jun 2020 05:33:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=rhC0j4t2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729032AbgFJM2V (ORCPT + 99 others); Wed, 10 Jun 2020 08:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728728AbgFJM2V (ORCPT ); Wed, 10 Jun 2020 08:28:21 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 116E6C03E96B for ; Wed, 10 Jun 2020 05:28:20 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id q14so1507177qtr.9 for ; Wed, 10 Jun 2020 05:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+g/QNFEcpPiOwSyTtWV6UhK4FMdUVFtGGz85G+f+/28=; b=rhC0j4t2YEoK08PnkL2fihhmC5XXVkrYeI4vb3VnKbwE+l9tdbbSmO2UgkqGtnyPlM A0GI3PJZEbPKn/4mia3nw1st3f5LEAUJ/4yoKbxTGeg/DRiLE/NmVjmolN4gSsplKLU7 amPaMjgFwZua3VOnt2Zy7xqvx+XlxhC82VvOKuAPgQ2RbNfnBlItygDqkAdoOT/xWXU9 Wk0yiDW1EFJ5x7iRkIj1gIZaK8JS1Fvrk9alFm1NrVleNsjzwxK9ULdORw3y+dXJeW5H jXzsHtnjfTHJmigC5tqVrgpSEfYqVtdxngTj/gbhYCrOPI1k3ODgCD4pfaNPsIwqt4xX 7gHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+g/QNFEcpPiOwSyTtWV6UhK4FMdUVFtGGz85G+f+/28=; b=kyNvwyxbRAwfS7SxJ8IOcvvdsVIgTUNEPkQEJiVORRxXYwHmqFk68xQeUhX3tw1bwU cy2s4YLlwsRCox43cEeiurwloxJSbwo/mHujjWVa+Y69YnIHguKFRvkIy9ASivJmQtt4 4MkHSDc2EAP44B4sgW56HKpQDLJsvzZtGQd5e6FtgEQ0pFd7zcd/b4OH67CDiegZw12g h7pnQR5+q5cZGSwg/8pkRyG4qPUYXL5a6YwIzqI5pGNpz6dfdnn25tVQ9tx9VRlALEkc NYwSKeuXe3Pn93KVSNtahn9sEFKfxggqILC/UNgeoqeipHH/zZGqnpr9N7ibTl0eumWq l7kg== X-Gm-Message-State: AOAM532AwOc2qifeWI5DPMKcDjIbXgaVb5XZ0i4DkR+FNmMHQYiP0rBU eaM5lZr+jMldth8alESiUOV8iGxxuPzYRw== X-Received: by 2002:ac8:fa7:: with SMTP id b36mr2997242qtk.100.1591792100186; Wed, 10 Jun 2020 05:28:20 -0700 (PDT) Received: from lca.pw (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id h64sm11681352qkf.46.2020.06.10.05.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 05:28:19 -0700 (PDT) Date: Wed, 10 Jun 2020 08:28:17 -0400 From: Qian Cai To: Alexander Potapenko Cc: Dmitry Vyukov , Andrew Morton , Christian Borntraeger , Kees Cook , kasan-dev , Linux-MM , linux-s390 , LKML , Heiko Carstens , Vasily Gorbik 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.