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=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 97420C64E7C for ; Wed, 2 Dec 2020 15:11:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D782C20B1F for ; Wed, 2 Dec 2020 15:11:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D782C20B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E447A8D0002; Wed, 2 Dec 2020 10:11:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF3CE8D0001; Wed, 2 Dec 2020 10:11:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D09E08D0002; Wed, 2 Dec 2020 10:11:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id BB59D8D0001 for ; Wed, 2 Dec 2020 10:11:41 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 78BC88249980 for ; Wed, 2 Dec 2020 15:11:41 +0000 (UTC) X-FDA: 77548681602.09.jump94_0405502273b4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 54B15180AD811 for ; Wed, 2 Dec 2020 15:11:41 +0000 (UTC) X-HE-Tag: jump94_0405502273b4 X-Filterd-Recvd-Size: 5031 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 15:11:38 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id p6so1275370plr.7 for ; Wed, 02 Dec 2020 07:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2HsmIMcZJpe7tYpMj4NnnC0QPe3wNYiaDnh9WVgHhJ4=; b=KQx3tJgz/INomXf3rio23NSDcD9wW4IAJav9Y9BJw53GdaN2o6fOGhlX8MBRbVEX/z GJnxX1SOpLw3TBSSXOyjEAGBMPEOzouTPbcvhMI11uEaxagjIn9JnLaNnxPM0y7ywI7W QyRN7MldGkgFmPigqQvsujyTvwSL/ZHKPFZbcRmkSH4l6Ffh9hFQWjY9Cuji5JSur0+X ghBUvBOcEkEyT+gIijLWQAdyC2cpWZ+DqUClF+JBkuzKgpn/U/kFgHckDgYHw8Gy8AAZ rY0WN/jM5PDSXnBHyekvdPvFYlBbw30fsPk/7X9X7VH+CC2mwj44NQzN7se3/lnMuMyV SatA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2HsmIMcZJpe7tYpMj4NnnC0QPe3wNYiaDnh9WVgHhJ4=; b=uEj18paDhVDxxKx+VXVZlqGARY/vqIFq3vzzKDhdnPdy/P7UaA/xFYPxkoCLvNaYET QpClaY32bWaACyARzCS3Y+sOeR8HOl+7TLohbGFkV3XVIOQmhX+OKf9yIxluT2eZkL3t arQ5PH0I/NGSPbdTEjqcW9XtfJ1tM8ksiB4UqIXb/6D1uPV3qBpz1vYNTA02TyTvVW30 bh6iV5P7LEmQhhTX8RaSCI7UWQcnCeqW1alY6/hMmQw6mNhGbYIVbPE9WrnaUiHdWsjO Z8f3/39NOm/r81m/u76lrWujpCzw8gY21PuSIr3dbONo28TtHA6zECl6hDGpXNQ0lsAf npsA== X-Gm-Message-State: AOAM530UJCXoRbiJSbUNOMT/rWqAvjf9G9m5NeRzNh5SXC85Fd6zJQoH V6gfr14fQQK89OATAxG0kwz2v9OnsCaii4iSzhwY+w== X-Google-Smtp-Source: ABdhPJzfWUqM7uNDjSRCST7XbyM6pfI51u3tJv0DhofJxxJmpsNwCOQzSTp65YnSwldtwCV6tKI7oV/ks90wuIfKTgE= X-Received: by 2002:a17:90a:6bc1:: with SMTP id w59mr319106pjj.136.1606921896689; Wed, 02 Dec 2020 07:11:36 -0800 (PST) MIME-Version: 1.0 References: <20201201161632.1234753-1-dja@axtens.net> In-Reply-To: <20201201161632.1234753-1-dja@axtens.net> From: Andrey Konovalov Date: Wed, 2 Dec 2020 16:11:25 +0100 Message-ID: Subject: Re: [PATCH v9 0/6] KASAN for powerpc64 radix To: Daniel Axtens Cc: LKML , Linux Memory Management List , PowerPC , kasan-dev , Christophe Leroy , "Aneesh Kumar K.V" , bsingharora@gmail.com Content-Type: text/plain; charset="UTF-8" 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 Tue, Dec 1, 2020 at 5:16 PM 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. > > 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. > > There are 4 failing KUnit tests: > > kasan_stack_oob, kasan_alloca_oob_left & kasan_alloca_oob_right - these are > due to not supporting inline instrumentation. > > 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.) Hi Daniel, Just FYI: there's a number of KASAN-related patches in the mm tree right now, so this series will need to be rebased. Onto mm or onto 5.11-rc1 one it's been released. Thanks!