Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp3637601rwn; Sat, 10 Sep 2022 16:53:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR6tEDAaKzrw3InG6QOF2stbjgFleLWScbQ+Qn3aSHIm9PSGv6QFOFjZj6Fz7gB53y50gJfN X-Received: by 2002:a05:6402:428c:b0:440:8259:7a2b with SMTP id g12-20020a056402428c00b0044082597a2bmr16640836edc.329.1662854024089; Sat, 10 Sep 2022 16:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662854024; cv=none; d=google.com; s=arc-20160816; b=YSfgKw997OIMEfPm1zOUdI/cddo0VJiCs8J+U8FRwor0Yaznpw/qEmkZivD56kkYWl Jk8SizOv4lw3ENiauLAhjq9o4Liu6dl4ZQ7xC5UoITb7VJy2wx4qN3d6ylTX4hMJ9F/1 5l6+YHi4VFxxuuJEpcc56z+r0HfQ66863zpAiyYf9sXwR0K/bIuioQgeOeZEQPhAGWkm 6tkwuTTRpsIbtdhClXpCGBOHGAUrpVyAMymsnhdAQGRvloUQQNfP4FqD05Bi1rIVB28N ngwH5y/F0ILsJPocd9/ztW5IpiJyKLhrGAXYShnN6nWb+16TB/QHFknthQ01H6bhMS72 zavQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gAh0um/m+ykZ+JIcJQ0J8f0pH78Jfp+soM0rxxd5C7I=; b=x3gqIjCYqRNRCs4HrZK1GFuTc3G/4Up65DfRmpG9CrI8Nma7Cn76RTnGv/tZ6rytNd stScVGEV/YZiPTzl0ZcvHLsY12kWJ5al3WsJLc4wrVA2DDfD5bqzmyg0tT6TGqBvvYAY oM+p+Dcfq2vwIG3rb0RH3dipcT0uA91Hv4lHJAjnkDVpMz6WtOe1aKPdoc/ZSSV7I/T4 69+9c1RSm+4KEF0CciSLvYMlDQN6KtETu06odWN1KOKatB7FOoyOJFBtdHr6FZUliIIz aQbeEh/yJm1Ivg7XHTYxA2MiZSMUl+8COlRAEnF1ncUeKmQluHna6MNuIKZPi9he2UZP r/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="P/X+iO8s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b23-20020aa7cd17000000b004405af7da47si3585440edw.564.2022.09.10.16.53.19; Sat, 10 Sep 2022 16:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="P/X+iO8s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229718AbiIJXXH (ORCPT + 99 others); Sat, 10 Sep 2022 19:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiIJXXE (ORCPT ); Sat, 10 Sep 2022 19:23:04 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A52241983 for ; Sat, 10 Sep 2022 16:23:04 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id d17so2978950qko.13 for ; Sat, 10 Sep 2022 16:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=gAh0um/m+ykZ+JIcJQ0J8f0pH78Jfp+soM0rxxd5C7I=; b=P/X+iO8smfwRNjyX+sIG6K2vmo0ffexU18WbP2Lly4u5YLMjeqlCim87Tp9gnyO3pM 8uEAjZJmua0E9d0HTMDNBzbqLgfCY5ucoaCmqlFSB9q4nbo2pvE/MXZOE2Ax8FaKw7fF MSzriN28pNkO3RL7uOo2AZEgGtsoLp7DNUilBrm2FhzvV4rmnByE6H79wfM3dO46ks+z HcQqnWyKxhlwwl8Epcr1oNj38tyzcylesf39DUuXQjhnapoLfgiA4zJOE4epWpUBgEL7 evAAASBxYnZlA5rG9jv4lYhOsMR9yhiJqeDIWtyUc7HrSJcopg9VmqfrAsSlNXfIq9Qo 3Bhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=gAh0um/m+ykZ+JIcJQ0J8f0pH78Jfp+soM0rxxd5C7I=; b=MaBu/8jmM25nRNC0RoDgXcByd+Ye6+vcTfKqYS0d+Sp47Ey+riUZ3sJLIMvbnzRqk3 obBq+xgEWOFW9hWVIrQivWZUu59C+76HEDRZpM7VxsPNLX8cShKeTkD/UoxRsTKbXbYM QLC4ZI8MWKFmaBvDywDrTEg85UykYD3HyxojwRX/8Txu2Lfjg9NA8Tji36UIORc6Jw7T Lh7T09OvdEiYxiSTIWKbUfdL04Dm/p3J9YBpuWW4Klszzn9ZuVCjJINJD+TN3eJroJ8l kuUsR1ZYVNElBzXeAM31bZyo9ISKaqmaQ7BK99fvdF7zkj+zcxrmyPdZk8VXOETLZPBt BXZA== X-Gm-Message-State: ACgBeo1z7ZpTXMv8lYhZMVwq0XsZr4aGvXs4KIGwZ00fg66u4DMCAoE1 0z0N0wUGyug0yvAbRKOeVH8RV8gTDWWNBjqEQdo= X-Received: by 2002:a05:620a:254f:b0:6bc:5763:de4b with SMTP id s15-20020a05620a254f00b006bc5763de4bmr14293905qko.207.1662852183307; Sat, 10 Sep 2022 16:23:03 -0700 (PDT) MIME-Version: 1.0 References: <20220907110015.11489-1-vincenzo.frascino@arm.com> In-Reply-To: <20220907110015.11489-1-vincenzo.frascino@arm.com> From: Andrey Konovalov Date: Sun, 11 Sep 2022 01:22:52 +0200 Message-ID: Subject: Re: [PATCH v2] mte: Initialize tag storage to KASAN_TAG_INVALID To: Vincenzo Frascino Cc: Linux ARM , LKML , kasan-dev , Catalin Marinas , Will Deacon , Evgenii Stepanov , Peter Collingbourne Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 7, 2022 at 1:00 PM Vincenzo Frascino wrote: > > When the kernel is entered on aarch64, the MTE allocation tags are in an > UNKNOWN state. > > With MTE enabled, the tags are initialized: > - When a page is allocated and the user maps it with PROT_MTE. > - On allocation, with in-kernel MTE enabled (HW_TAGS KASAN). > > If the tag pool is zeroed by the hardware at reset, it makes it > difficult to track potential places where the initialization of the > tags was missed. > > This can be observed under QEMU for aarch64, which initializes the MTE > allocation tags to zero. > > Initialize to tag storage to KASAN_TAG_INVALID to catch potential > places where the initialization of the tags was missed. Hi Vincenzo, Cold you clarify what kind of places this refers to? Like the kernel allocating memory and not setting the tags? Or is this related to userspace applications? I'm not sure what's the user story for this new flag is. > This is done introducing a new kernel command line parameter > "mte.tags_init" that enables the debug option. Depending on the intended use, this can be extended to "mte.tags_init=". > Note: The proposed solution should be considered a debug option because > it might have performance impact on large machines at boot. Thanks!