Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp436596rdb; Thu, 2 Nov 2023 07:59:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYwt/gzQNUQCO61/he3HvgDPc3Y2Zy1aPlsyEaKII9EgmAJhtQR3E3iXFkzn0LIFAYj/Qw X-Received: by 2002:a17:903:1105:b0:1c9:faef:5765 with SMTP id n5-20020a170903110500b001c9faef5765mr18592758plh.5.1698937147265; Thu, 02 Nov 2023 07:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698937147; cv=none; d=google.com; s=arc-20160816; b=gb8eaBsTSMak4qSQSCinLOMXD7XhAzRUDZDOFzPGoZ0bQnhgWPoe2A7yrhjyfjcaiv 52qlnKSR1UxPK3kjLLofBwirxDSTdAkKEsZC/YkSTccPYn0GuB9JeufgInyBddDqr2hR 7jcLF+6N41ZtoXlHd4xcoroxxXifx1CpbOraxnfVgikYXhB9ka/CzJo4B2kyJOJZhnJv +RXX27YtyStk70xT2mnO3G4YuLwxApw7RlkFFH3fpnPY8XNwyvTHt3DeEptuCDljQHmo DVdbIcqZAhNcskcwIxDC9ammEbxaK65MVUtVfGqURVysVJVLT7m2dVj2LiCoi7PNark1 1/LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=V4u7No3WKyf2rx02w8WP9k4VSXCaz8LOG7ZTnqR2+ek=; fh=ryOnPr3C6ahf4FXGiLv6MVMeJ7GFuwecZ2iLNzMX0nY=; b=TPg2J/jWJog+6WRjH5R3DHqVKSLPZAte4RSuThEM5frXxhZ+N3+3ozRxM59VtV1VRw MTTIIki5nHMiVI9kTPkPJxv9DOJ+l0hBVhfk8VOfTs64MMH+C8FfHbwtU0a0aIKt0GDi aJQvwMHxoAlapIaTTfqWk1+FJZHgRbtub4CwSuvH1FV7lCC+Xru1a/JYW6FboB9HRP9I T7A6m3hTnU1GeloTjEgkPnuJGQEMN459HvceT+1jQIhIhJh3CAZvWzB9CBFXYhYRupe3 laWBy7aoQdnNILGPZrAzvBhXRoZa33+NZawACrPngxXyn7dBGPyHA7kFphp5WmoAUmiQ 3LQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OHHp3kAy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q21-20020a170902c9d500b001bb0ba81053si10821pld.50.2023.11.02.07.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:59:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OHHp3kAy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5C81D810F0DA; Thu, 2 Nov 2023 07:59:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjKBO7A (ORCPT + 99 others); Thu, 2 Nov 2023 10:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbjKBO67 (ORCPT ); Thu, 2 Nov 2023 10:58:59 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED634199 for ; Thu, 2 Nov 2023 07:58:56 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5ab53b230f1so744725a12.3 for ; Thu, 02 Nov 2023 07:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698937136; x=1699541936; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=V4u7No3WKyf2rx02w8WP9k4VSXCaz8LOG7ZTnqR2+ek=; b=OHHp3kAy8UYX+xqRVRUytgJFU646IvQeUQRZw6jf12UWISfC/CWNcDb/akytaeMOh5 hWG5Ec1PVN8jpAfR6XOTycQ3QHqSf7XMsjBWylfDfBJGAyfZ5KrzJLaIkX2FeAPDVGOQ g4lbQtzQsmFrF8JVvkl26knMiWUjZb3nD+s2M+F2Z93TPF8Sb/odHPzvkwgYRydt9Zwx Uma7GxzFPS2rS5XtHwcr8I7Ih7YV3xdjNVlSAD+DwR2rb7i+Qu2jzI96Fyl87zrPRJj+ fhHs0/NKFeXThIiASQYAmggbs8mJ4vMc8xPvIxyhyeObMDf62aNtshA54SKyqJOAoGCR YylA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698937136; x=1699541936; h=content-transfer-encoding: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=V4u7No3WKyf2rx02w8WP9k4VSXCaz8LOG7ZTnqR2+ek=; b=iZRlth02gAX0lfh6nYvFx0s/VIJMz5yNYN7FNxAGkcAzANk+ohF/2t0BKs2R/bWe/+ Tn2QjTd6Tom2D4I4bveHKPHfazr+lIIa6YIcGf+B7TGMbM9k7ZsC8V++Ru4i8tyw2THD 3AnGIIdCmb+WLyxmEOJfjMwDb+hOAZJHskE61vS5jJtXeq3hfrt8qFj6gZNkhKRZSE/o QB4UByiYv92xeW2qICqzI7a/btbx+u4HBoHgYdC3n/IabWTNMSH9uUsbFObVbOVA4T78 WQiK01NhCn+rgAOZ6+BiY8Ta1jupeNL6pwd1mprxccMBlNLul93hKQvRoHYsXkK4YirY VEnw== X-Gm-Message-State: AOJu0Yz5sncZHKU911ECxzoP0Xhou6KM62dyC+6cEcs0ags5ekC/4fA9 gzgH2EheLKYl8xqKaBuFUuzvatlMNDwWGJ7zrak= X-Received: by 2002:a17:90a:ec03:b0:280:664d:cd9e with SMTP id l3-20020a17090aec0300b00280664dcd9emr10351944pjy.19.1698937136368; Thu, 02 Nov 2023 07:58:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Thu, 2 Nov 2023 15:58:45 +0100 Message-ID: Subject: Re: [RFC] mm/kasan: Add Allocation, Free, Error timestamps to KASAN report To: Dmitry Vyukov , Juntong Deng Cc: ryabinin.a.a@gmail.com, glider@google.com, vincenzo.frascino@arm.com, akpm@linux-foundation.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, "linux-kernel@vger.kernel.org" , "linux-kernel-mentees@lists.linuxfoundation.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:59:04 -0700 (PDT) On Tue, Oct 31, 2023 at 10:46=E2=80=AFAM Dmitry Vyukov = wrote: > > > >>> There is also an aspect of memory consumption. KASAN headers increa= se > > >>> the size of every heap object. So we tried to keep them as compact = as > > >>> possible. At some point CPU numbers and timestamps (IIRC) were alre= ady > > >>> part of the header, but we removed them to shrink the header to 16 > > >>> bytes. > > Do you think it is worth using the extra bytes to record more > > information? If this is a user-configurable feature. > > If it's user-configurable, then it is OK. FWIW, Generic KASAN already stores the auxiliary stack handles in the redzone, so the size of the redzone header is 24 bytes. Perhaps, we should hide them under a config as well. However, the increase of the redzone header size will only affect small kmalloc allocations (<=3D 16 bytes, as kmalloc allocations are aligned to the size of the object and the redzone is thus as big as the object anyway) and small non-kmalloc slab allocations (<=3D 64 bytes, for which optimal_redzone returns 16). So I don't think adding new fields to the redzone will increase the memory usage by much. But this needs to be tested to make sure.