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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA118C433F5 for ; Tue, 7 Dec 2021 19:46:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24EC06B0073; Tue, 7 Dec 2021 14:46:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FD176B0074; Tue, 7 Dec 2021 14:46:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CF996B0075; Tue, 7 Dec 2021 14:46:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id F071C6B0073 for ; Tue, 7 Dec 2021 14:46:45 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B93278249980 for ; Tue, 7 Dec 2021 19:46:35 +0000 (UTC) X-FDA: 78892030350.18.2F5D2E7 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by imf05.hostedemail.com (Postfix) with ESMTP id 60797100002 for ; Tue, 7 Dec 2021 19:46:35 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id j21so101077ila.5 for ; Tue, 07 Dec 2021 11:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UOHRGFoWJlaN8tZPy553Y82VWtjgN1BlER86UYqi7dc=; b=kbeI/w+qD4yKPDBLOU9Vb8XSOkuHvE3MWoFQK7gF82IjYoJnN7SeYJIwRVeZb9tODX wA71cTAgvLDHvNDwE45gipdH7SvuxJkdZnYLALmDjeeXtx7K/4A9Yf2qJ+KUw17gZQui os6iVP3dMXnU9ptd5TPR+HS3ApligrIj97yro5p6mKnD+NQ72HXFRB5SH+LpZRdR58ak c7aI953UpGxgWvHAcvuBqNkcw7C42RWArYGhU5I6ffNyc7juzDJRfRhe+DLoV4IQRzWN HGot5OlvIrvje74IKDd+bfVHkXteXbtDcxjDxroXNZzzLx3LZjx7Z6kL8knfN4URx3Lr Uq+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UOHRGFoWJlaN8tZPy553Y82VWtjgN1BlER86UYqi7dc=; b=siJ5SamIeabfoRI5O/2Mpb2skGqEYBZEfuRZMqUjINbPj76xyafi+eDptLiovCvW5S qKR5LVJAWX9FAFv+m8gNtI4yXWVt8ivgXNvJp9HmLQfrarpAUw32dUe4iuwsjY0xnvzX zdi0PJfM3TITSoWN6VOE29PjIeJlcu5alB4IDvKbruR+O7JbVaJivGKwJzDYtiXhsKdg p5ZGXWB/7OKx+zYydYwrmHzXOeFGIFW8rXVbYCbcD0pN2g+Tf5XURwVmLt/9N+K1pmWz ZACoIH7n831Wg2SXvDOC41c03n0tu3vju8h1ihO4TIV2QPXyRfchsU1VbufT6ITO8Mz5 DZ8A== X-Gm-Message-State: AOAM5321GKraSSmKuDP0UI8/gqM/V7s51GncNzGPk+hpTDEepfcIdvOL CvDWwcDZ3gKfcSjs1Uic70kjxqchWvFp/znyO50= X-Google-Smtp-Source: ABdhPJxJJ/EuqkW4k0dLfegGojobOFNuQzz7lDAXMVGAZuN0AYbIsAoyzIAuef6gWMajyQlp1Dj1+WZjraixA7hWvbg= X-Received: by 2002:a05:6e02:1605:: with SMTP id t5mr1720750ilu.233.1638906394679; Tue, 07 Dec 2021 11:46:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Tue, 7 Dec 2021 20:46:24 +0100 Message-ID: Subject: Re: [PATCH v2 00/34] kasan, vmalloc, arm64: add vmalloc tagging support for SW/HW_TAGS To: andrey.konovalov@linux.dev Cc: Marco Elver , Alexander Potapenko , Vincenzo Frascino , Catalin Marinas , Peter Collingbourne , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Andrew Morton , Linux Memory Management List , Will Deacon , Mark Rutland , Linux ARM , Evgenii Stepanov , LKML , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: sy8mijtk15dbe31d9tiauio7iym7nyga Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="kbeI/w+q"; spf=pass (imf05.hostedemail.com: domain of andreyknvl@gmail.com designates 209.85.166.179 as permitted sender) smtp.mailfrom=andreyknvl@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 60797100002 X-HE-Tag: 1638906395-853922 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 Mon, Dec 6, 2021 at 10:22 PM wrote: > > From: Andrey Konovalov > > Hi, > > This patchset adds vmalloc tagging support for SW_TAGS and HW_TAGS > KASAN modes. > > The tree with patches is available here: > > https://github.com/xairy/linux/tree/up-kasan-vmalloc-tags-v2 > > About half of patches are cleanups I went for along the way. None of > them seem to be important enough to go through stable, so I decided > not to split them out into separate patches/series. > > I'll keep the patchset based on the mainline for now. Once the > high-level issues are resolved, I'll rebase onto mm - there might be > a few conflicts right now. > > The patchset is partially based on an early version of the HW_TAGS > patchset by Vincenzo that had vmalloc support. Thus, I added a > Co-developed-by tag into a few patches. > > SW_TAGS vmalloc tagging support is straightforward. It reuses all of > the generic KASAN machinery, but uses shadow memory to store tags > instead of magic values. Naturally, vmalloc tagging requires adding > a few kasan_reset_tag() annotations to the vmalloc code. > > HW_TAGS vmalloc tagging support stands out. HW_TAGS KASAN is based on > Arm MTE, which can only assigns tags to physical memory. As a result, > HW_TAGS KASAN only tags vmalloc() allocations, which are backed by > page_alloc memory. It ignores vmap() and others. > > Changes in v1->v2: > - Move memory init for vmalloc() into vmalloc code for HW_TAGS KASAN. > - Minor fixes and code reshuffling, see patches for lists of changes. > > Thanks! FTR, I found a few issues with a tag propagating to PC (in BPF JIT and a few other places). Will address them in v3.