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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30C82C433EF for ; Tue, 7 Dec 2021 19:46:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236516AbhLGTuH (ORCPT ); Tue, 7 Dec 2021 14:50:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231772AbhLGTuF (ORCPT ); Tue, 7 Dec 2021 14:50:05 -0500 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EFC8C061574 for ; Tue, 7 Dec 2021 11:46:35 -0800 (PST) Received: by mail-il1-x131.google.com with SMTP id 15so116660ilq.2 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=YKyNwookvDelWW1mU9jwwh/LEpud584cU/bX3o2kwYf604NZ9laFiE0i6kmuJDVdpa LpqCUO+U07HS7opDyulWQ+nOrMf/D+NLaD1at1KAWOLdUY9bjPtpZ3QDN7GAlVA9RtBN ap6zRNtmVnZXDmXjGfpoIGek+NQPUK43jze01/jMOCOuiKh6hCbAVBYTSa14eRK377hS QdkhysSY5iNOR2csqM42xjXaDIiSOCX1UZGa91bNqVBZPb9e+Oi7Bzp19AWhJxRTtMN7 XVTrzfqS/ffS7cehXJoJjaMSnI96jH7LSD6nwwbh8AyDBHbuqXo7hihrGLCfLdxKabhc XvMQ== X-Gm-Message-State: AOAM5305bDJeqdbo/H1g6u1otm9nXdLfEynI6WXh147khlJBfqdoSC9A bU61O1iUHg+vOAgz2CUdvNTG1Y3lxAOlhG/RAuo= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.