From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C60EC433C1 for ; Sat, 20 Mar 2021 01:42:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E539761970 for ; Sat, 20 Mar 2021 01:42:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E539761970 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 619526B006E; Fri, 19 Mar 2021 21:42:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C6046B0080; Fri, 19 Mar 2021 21:42:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 443246B0081; Fri, 19 Mar 2021 21:42:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 24FE86B006E for ; Fri, 19 Mar 2021 21:42:09 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CB83EAF84 for ; Sat, 20 Mar 2021 01:42:08 +0000 (UTC) X-FDA: 77938551936.30.396D8EF Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf07.hostedemail.com (Postfix) with ESMTP id 4D3EDA0009CE for ; Sat, 20 Mar 2021 01:41:08 +0000 (UTC) Received: by mail-pg1-f173.google.com with SMTP id v2so4850698pgk.11 for ; Fri, 19 Mar 2021 18:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oWdIOPAkZfr1BoujvrjjbGLV84XJk3QFa5vSlgO7ACI=; b=sOLb6DanI+zm5MFPForuIykm6CHj/PtN+oXFpBhQmcrrR5idcrXbqKnIB7N7bOLuuq p3SHcXX/mt2M8rwjX5aN1Zi259kXlIpgHYettXIDWhdimrHhk+Czv1vdVdu2qE7+6qPL L0T6JZYa+2G9AYm3I+7Qlt9VVMnF6WXsT+z5FLopQfWZ1lJBeyOPI4EStu4fORX+AmE9 jKSsOp5uQJq89Fa140cV2bxJfA+y3+ztNrbSUgg8HuvDu2UMGQM/wd4jwomQqtlkM6Tf c0iG8fb5Q7CezO2+iLCMHy8JrhzfTpqxrQzgF+F24HUNU1v5itQx039AKXGvcEFMvqmD WVhw== 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=oWdIOPAkZfr1BoujvrjjbGLV84XJk3QFa5vSlgO7ACI=; b=id3CxOhWtD0+j3ggtJXouAa7J7ZSuSgzT/QWdOVl20e4g6ip9z/zwqpFQbSdOakBce xifheJHteg8Gp7NtUC8hbUs5RImdQ0KAeJtCH5Otu9vRDpvYscS2pE/OxKJgTaSF8LHn v+luqtGnZOeZIZkg8AelB5Cs2lWGYJZbbZb3WojUPhsQlekujz+NRdd/UYUyu1pBFXOP OfyJ5j3DJUGdi+kE9pk1SL1jDlChGGUcB8UZgAQ3xxJDxpDQDOapzhktIJNAttDw7wUU 2BPkKyg2MVHldz9DS1BL7yAohDhRNv9XgOgJkHZ3UAppV0CdN8Z/8iZFDGpaokLDqCU5 8dPA== X-Gm-Message-State: AOAM532u6zRR7O6bfvNK2sd2BWSt2OvzryIILYrDsPV5UN3H59jdiua5 Zz3EqjsVIxFYYaCN1atKldk= X-Google-Smtp-Source: ABdhPJx0W9fCwaT8UQdJG3P26P2B6HAB0ynZeZvZHx2tVy0Y5WbW6HCKUtmhyouZzzOoxt8gqGFNZg== X-Received: by 2002:a65:44c5:: with SMTP id g5mr14108950pgs.295.1616204466016; Fri, 19 Mar 2021 18:41:06 -0700 (PDT) Received: from localhost ([103.250.185.142]) by smtp.gmail.com with ESMTPSA id y29sm6830981pfp.206.2021.03.19.18.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 18:41:04 -0700 (PDT) Date: Sat, 20 Mar 2021 12:40:57 +1100 From: Balbir Singh To: Daniel Axtens Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com, christophe.leroy@csgroup.eu, aneesh.kumar@linux.ibm.com Subject: Re: [PATCH v11 0/6] KASAN for powerpc64 radix Message-ID: <20210320014057.GA77072@balbir-desktop> References: <20210319144058.772525-1-dja@axtens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210319144058.772525-1-dja@axtens.net> X-Stat-Signature: bx73xu37pdpoqtzzqackqqhethj55436 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4D3EDA0009CE Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-pg1-f173.google.com; client-ip=209.85.215.173 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616204468-442165 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Mar 20, 2021 at 01:40:52AM +1100, Daniel Axtens wrote: > Building on the work of Christophe, Aneesh and Balbir, I've ported > KASAN to 64-bit Book3S kernels running on the Radix MMU. > > v11 applies to next-20210317. I had hoped to have it apply to > powerpc/next but once again there are changes in the kasan core that > clash. Also, thanks to mpe for fixing a build break with KASAN off. > > I'm not sure how best to progress this towards actually being merged > when it has impacts across subsystems. I'd appreciate any input. Maybe > the first four patches could go in via the kasan tree, that should > make things easier for powerpc in a future cycle? > > v10 rebases on top of next-20210125, fixing things up to work on top > of the latest changes, and fixing some review comments from > Christophe. I have tested host and guest with 64k pages for this spin. > > There is now only 1 failing KUnit test: kasan_global_oob - gcc puts > the ASAN init code in a section called '.init_array'. Powerpc64 module > loading code goes through and _renames_ any section beginning with > '.init' to begin with '_init' in order to avoid some complexities > around our 24-bit indirect jumps. This means it renames '.init_array' > to '_init_array', and the generic module loading code then fails to > recognise the section as a constructor and thus doesn't run it. This > hack dates back to 2003 and so I'm not going to try to unpick it in > this series. (I suspect this may have previously worked if the code > ended up in .ctors rather than .init_array but I don't keep my old > binaries around so I have no real way of checking.) > > (The previously failing stack tests are now skipped due to more > accurate configuration settings.) > > Details from v9: This is a significant reworking of the previous > versions. Instead of the previous approach which supported inline > instrumentation, this series provides only outline instrumentation. > > To get around the problem of accessing the shadow region inside code we run > with translations off (in 'real mode'), we we restrict checking to when > translations are enabled. This is done via a new hook in the kasan core and > by excluding larger quantites of arch code from instrumentation. The upside > is that we no longer require that you be able to specify the amount of > physically contiguous memory on the system at compile time. Hopefully this > is a better trade-off. More details in patch 6. > > kexec works. Both 64k and 4k pages work. Running as a KVM host works, but > nothing in arch/powerpc/kvm is instrumented. It's also potentially a bit > fragile - if any real mode code paths call out to instrumented code, things > will go boom. > The last time I checked, the changes for real mode, made the code hard to review/maintain. I am happy to see that we've decided to leave that off the table for now, reviewing the series Balbir Singh.