Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4869630rdb; Tue, 12 Dec 2023 11:30:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IENapcPiiF4mhTO7Vf5Ct+EXPO2eiEUiOqhHTKEL8tXs1F+Nw2DrPlsUifFrLYb3R/M/f43 X-Received: by 2002:a05:6a20:431a:b0:18c:9856:8ce with SMTP id h26-20020a056a20431a00b0018c985608cemr4046908pzk.6.1702409450374; Tue, 12 Dec 2023 11:30:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702409450; cv=none; d=google.com; s=arc-20160816; b=K6+gE/bsI/ULxwBBu9skjzgYW1k9w9soGLuAvKIMQo7wI1kFb5/VouHj4d9+rwIzCN jpjchZlNlgGKOJX2dylO4++zGwyvSfnBlzdKWPt2VBUjng0usAEW0Zv1qPNeH1fwIcNp vR33MppK8JGc5d7RSovoftIpKolAfNs73eLOW/R5yVyI1p+4277nWx+Rgie2ofDcVDPX OJ0IARItfdSybmBKUieniNptolf45MjBD0z2+Yj1drCURprDVClM9d48b2Ef87li+SZh 1xQqtnRRxueK8yDv6oQvSYAFJaz0LiX8K9xO48h+/SCvUldMYph6rNwdFLMxDra5R+JU pxPg== 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=Pcoi2NJ5WlkDrXij7nG/i+1L6bQHIDHmRGBrwHts7ds=; fh=U+LkbmzWWCZxhGJEzEnoma1O4OhNrWGKYws0tLC4nok=; b=rHAq4+AL7dSQYGW5rOO4UJTjHePip10n1eybl2q6yVlzDBtEdP5Ig5UfDKSffCm6BB TyaUwJjJeOJvt7YY5MrM05+dXkxk4Lpbii0B83IE0UCgfMiu13MfpxkqEmYuoBP1M1/S oEUq45yEf1g+RKyWJTW8yubBGQ8tLZIIC1mQXuhMJEC8ST6sjA7J958dlYs5F1UgUBZf BkMwViQ3K172G+NjQkKDriA3MrkWnyURKwYIXuqft/oqULVgfeBfpgTm3fQcP6gFFQJN gxMYj5GwdlfD9/XZ2K4fa5kQPDc1XuDUPMQUNawlAFdzX1LP1sNIZDo51pwEVd+U8C5t lauw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=NP3mBX4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o198-20020a62cdcf000000b006ce03f8d014si7893862pfg.391.2023.12.12.11.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:30:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=NP3mBX4G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7CAD480A64DE; Tue, 12 Dec 2023 11:30:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233052AbjLLTae (ORCPT + 99 others); Tue, 12 Dec 2023 14:30:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbjLLTac (ORCPT ); Tue, 12 Dec 2023 14:30:32 -0500 Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB719AD for ; Tue, 12 Dec 2023 11:30:38 -0800 (PST) Received: by mail-ua1-x92c.google.com with SMTP id a1e0cc1a2514c-7caff8105dcso745308241.0 for ; Tue, 12 Dec 2023 11:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702409438; x=1703014238; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Pcoi2NJ5WlkDrXij7nG/i+1L6bQHIDHmRGBrwHts7ds=; b=NP3mBX4GA1YoBym7tucbXITo6X8XoXE0VbjhYiHuPQP/3egsZhq+knW+pOqNNVdopn yrgtO9vKZt2abkyv73Pyps45IRe+ZyF9NMDtMs3PIzCkN10k8LS5UR7JttCwjoPnielO nB9rrbsjdsdNiWdPHQphhV39PtPm310Be5kZeZUUfTAv+Qxq8f449aOXT3KbNU9yKJh+ 8ZIoI6pq6vcnBcuY660jtCPzaFk581fLPzNC8lZZMGyX0caKqLOYirL33JWvD/lyGN5H NSNqchTpNzdTBZOhqn9jQG4nEOUbqo6Q3ffaaV+2lAtdR70HrIcRyugMBl7Nhjy3iz/I zC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702409438; x=1703014238; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Pcoi2NJ5WlkDrXij7nG/i+1L6bQHIDHmRGBrwHts7ds=; b=BKRJ0CDiii4RaeMMthR/uWxOPpuD97Msq3xVkt4oYqMO3VAevOlEGZdeI7c9XF8ulA 2TYywxlPzC75pWmeeHsGvKuMOeIX3D0yhs+Dymgiwp8H6Dc7Y0mak31QHhoCAvIlKRmL k9KCL5Ys+k46b0gCNpgT0TU7C3j4CUHbBfMkvcnYA5CHBlb2x3zdI6+ppEURyeekwlDD mWEuM4eue/M52+rMcuIAmJVn3P5/FDdlCaoqI6pTlFatdq3gOD2tElp3YdLIbZeHkiB/ Is0sXf9eOlwnp2nSM7viI0imN4xKWCUiSLgxFeng5jrgg9wDK12n0pk3e9YWSWgotlLS CExQ== X-Gm-Message-State: AOJu0YyLIwEa52u3U8RctkCXQQ/15YFDDDav+4qvz2R4X7PRfP8h1DI7 KQUPbjQSUGbza/zCrpzd+KgG1VVskXe4w8CGEh17Nw== X-Received: by 2002:a05:6102:510a:b0:462:8ca2:1bb0 with SMTP id bm10-20020a056102510a00b004628ca21bb0mr4858842vsb.20.1702409437702; Tue, 12 Dec 2023 11:30:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Marco Elver Date: Tue, 12 Dec 2023 20:30:01 +0100 Message-ID: Subject: Re: [PATCH mm 3/4] kasan: memset free track in qlink_free To: andrey.konovalov@linux.dev Cc: Andrew Morton , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:30:47 -0800 (PST) On Tue, 12 Dec 2023 at 01:14, wrote: > > From: Andrey Konovalov > > Instead of only zeroing out the stack depot handle when evicting the > free stack trace in qlink_free, zero out the whole track. > > Do this just to produce a similar effect for alloc and free meta. The > other fields of the free track besides the stack trace handle are > considered invalid at this point anyway, so no harm in zeroing them out. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > > This can be squashed into "kasan: use stack_depot_put for Generic mode" > or left standalone. > --- > mm/kasan/quarantine.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c > index 265ca2bbe2dd..782e045da911 100644 > --- a/mm/kasan/quarantine.c > +++ b/mm/kasan/quarantine.c > @@ -157,7 +157,7 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache) > if (free_meta && > *(u8 *)kasan_mem_to_shadow(object) == KASAN_SLAB_FREETRACK) { > stack_depot_put(free_meta->free_track.stack); > - free_meta->free_track.stack = 0; > + __memset(&free_meta->free_track, 0, sizeof(free_meta->free_track)); > } > > /* > -- > 2.25.1 >