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 9A3BAC4167D for ; Mon, 30 Oct 2023 09:28:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDA516B0192; Mon, 30 Oct 2023 05:28:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8A316B0195; Mon, 30 Oct 2023 05:28:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2AAC6B0197; Mon, 30 Oct 2023 05:28:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AA5726B0192 for ; Mon, 30 Oct 2023 05:28:23 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6F508160572 for ; Mon, 30 Oct 2023 09:28:23 +0000 (UTC) X-FDA: 81401602086.24.449627E Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2034.outbound.protection.outlook.com [40.92.89.34]) by imf18.hostedemail.com (Postfix) with ESMTP id 9F4E11C0015 for ; Mon, 30 Oct 2023 09:28:20 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=tpW0uOgq; spf=pass (imf18.hostedemail.com: domain of juntong.deng@outlook.com designates 40.92.89.34 as permitted sender) smtp.mailfrom=juntong.deng@outlook.com; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698658100; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZqT/8YncguOhIyosUBuYGPfPwNGl65kK/vqaQ9wFNKo=; b=g6lZQ7frFYvbKwG8xsI+E3yw5ng/qklBz2EClLi5eRdVC9/T25PIWoBgJ0s/h8ZVCjgJix w/UHLjfxWfXtroHfwoCxoSkoBU5g3Oplr41wxCaBVWb5VuBY22TEGlfRdAT6+pg2oa3/lj lNVoLrR9EVMJrJge+KPOWlnHWTUeYQw= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1698658100; a=rsa-sha256; cv=pass; b=BQLSmu+NefHlyvj6S0EgkPHeN4G6PXZJqJlo6TNMtmltbDjdW94cJ50ic8ku2vWgYlIe48 Vfh6fTZN4LMCMN95UovPOpnphPKRNgTGGUV/XR4Xh/qjxHy9ERkIEwvlyy/pVtL98WDPYC tQ766iWSY5t0Aw5JTAiEu2bqQMBrQH8= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=tpW0uOgq; spf=pass (imf18.hostedemail.com: domain of juntong.deng@outlook.com designates 40.92.89.34 as permitted sender) smtp.mailfrom=juntong.deng@outlook.com; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ibd6hGvhs2g9tl859UTTjiIigyKdQfPSpHXena2pcKk1yxfOqjTXaS48CuWmZxzdTMPxk79KKNRXeAddqEgItG2IOG1cEQxFh0CLcJFvGuAbiRQ3gsOavPEuCwGzfmUDH0nMmN6LO1wrTrV6Nyx6MFFWB+WQRL6U6gk/Z5/xKr6vxgDd3fo0TV7Ft/T92rt3zY6K7NkAQswk02I5FfgpF7N2wOVBjY3MZ91mZdzlVciw3goiaJcV/Fo/hKlMUaS5gaPl7KZ5NURTDRGCC/IemtHvUpKCY8cFqLkDMLTi7tO1HFDa0CSCmstytODulmQscShj33oQMj5UpcxiKp6Wsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZqT/8YncguOhIyosUBuYGPfPwNGl65kK/vqaQ9wFNKo=; b=V3ww8ri6VwKt5LfTBjvlROCt5ddCCpfG+Ta85d1yifA6IrO/omRwcfK1ibBiM9Hv/I2ukzWruE0fO3fM4I6+anNXJUazWoUXSSbuurnFSMVPWmrT6wwtcZrQIdzOsNXH4tE5sLfIYixWaBhyrc7kobrHjtYFsA+LwFCP34egbr5KzOt0xLHAMqzqbz2A0LcVG0qIyRkpmqRdnMj0pNkYF/sZFspEBfL9PLxNDZ72OX5rGkbACSRXQTV/xligkOaPaMYvV1Pb/2Xu+VNryEOVzfHZVplCB72L0Z2FU13mi1AY/AW48h64c8o/yHP1anGYai9DhyxMS/xrZhdcaj9/Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZqT/8YncguOhIyosUBuYGPfPwNGl65kK/vqaQ9wFNKo=; b=tpW0uOgqMYqWzsJQYVLDqDmKB19F/kn4nu4RrAUcyhYT+FY12T26b+sfHwmLK3mJ2/xRAHjCmq8Vy4K5duCVoksDyWExM3FwpAKJPyFm4aOcl4mb3cJvbvib0i9jWo8SMJtvZO72q+eOrQw2ISIUF6KGdx15c18YTVMwMO4pd36nJ5YOmgKC3xZdatgOwOt1zIeKNbE3zAddav9cExZqL7ghq7vKi9MiMWEbbGQKHlouQ7X8mSyeMSBH/8pEve+yamWFpMSTyKsg1wTNWAbvHOAVKNpnJiQaJ2brrUydO0O8wauIeT7grEg8qTldcJE15qQbg0JR74sJL1lxk/zlQQ== Received: from VI1P193MB0752.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:32::19) by DU2P193MB2276.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:2f3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Mon, 30 Oct 2023 09:28:16 +0000 Received: from VI1P193MB0752.EURP193.PROD.OUTLOOK.COM ([fe80::2db3:2c11:bb43:c6e]) by VI1P193MB0752.EURP193.PROD.OUTLOOK.COM ([fe80::2db3:2c11:bb43:c6e%5]) with mapi id 15.20.6933.027; Mon, 30 Oct 2023 09:28:16 +0000 Message-ID: Date: Mon, 30 Oct 2023 17:28:15 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] mm/kasan: Add Allocation, Free, Error timestamps to KASAN report To: Dmitry Vyukov Cc: Andrey Konovalov , 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" References: From: Juntong Deng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TMN: [KAEsTGjx5ST3o4Xm9YGpFWbUHuXe4GVX] X-ClientProxiedBy: LO4P265CA0069.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::12) To VI1P193MB0752.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:32::19) X-Microsoft-Original-Message-ID: <403c50a2-8ae8-4f0f-95c7-d1962016f834@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0752:EE_|DU2P193MB2276:EE_ X-MS-Office365-Filtering-Correlation-Id: 403546a2-f2d7-440a-d2be-08dbd92a8bd3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6jj0O+5M3fyW3HfpNRjX+qne1OtKcUUCcBSKFrpB+cUvq+vMuaVqjDap538Xq/kPu7WURP7+knPrK5z63t9fCJrTznNHRwmpwbU9XJRJnKVz3tICKWedlYx5a1vmlrHleK6HQF2o1prQvht1MiLENJgeC0WHdSbFY/XQVPZ1TMfeEreVHaa6VOiEMyhV1Hvzk1xWomysvmhjZMzwSiz7+aXL0P79sEUeAH8W/NT6fug9c/Ff4vAgGb0FxX8ZG62U6QpNcgcMn8lRVNe2isR4rUwGqjcUz5AtozyataUht7H1KY2kYD/MuG9CTxppE3rRB7JyMjqflz6crs2xxdk1c9J64I/vTRvbispeHsg6VWZP1VEFxV2iaetRRPfhGGw44SZ1nCuahk0DWZhVciSwgj8ELHzrKhacXMczoGlJDEs/WU0KSAvMSCSj5KZl+aFTMgsB0v4JCDEpE2opZ7IIFHZo2dSfoNXjB3PSc7iDi3kG//vc/oPPCt+SiFu3g/Lm8wsAMD82IfLxkmP/w8TVlGMQ7RHVIfd34tWuvWQzngUba3/32f+l6nJ43S3dPoGp5GSA+YD4wQiQxU2v1Nn6JBEwXcmYVZqLXsM9gDMLMa0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NHR2cXlmS3Q1N2xkSHYzWitkc0kxSHVBbnMvQUZYM1FRUHR0TzJIc1VoWkVJ?= =?utf-8?B?RVlscFhSZzlGTDJ6d0ltVEd3MmdOZmJ2VWlvVHA5a1czNlRhamdmLy9DcU9J?= =?utf-8?B?dkxXcFhKTTNVOVpuNjB4eVRJMUVTbWdnNHdrUWhLSWYxTVBpUmZmMWFBWnZV?= =?utf-8?B?QTkrYmNzVkJ2WWFpL1lXaXdQQkdvWVd2OVVUMHRsRnUyS0RUWEFOUWp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lVC94NkczSUJY?= =?utf-8?B?YlRPc09GQ0FZcFlYVTRiRGFNUTY5OTQvZnF2MW5xM1Vlcm00QSt0UCtaZ3Rz?= =?utf-8?B?Qko4TmFhT3grSk5TZGxwdlZCQ1NjR2NGc3lGQ2JIV3g2OUVRL1FGSUlCRWt0?= =?utf-8?B?bXFDNGYxYkNXbHdObW9HYVFUMGFEVDZnbExRaXRsajJadWZWNVNoOS9GRTJn?= =?utf-8?B?UXA0VWJsSU5ieHNIT20xTFhlRk15QXlzYmRZY29FR2llM2pEdWlsSHpoOXJo?= =?utf-8?B?VWs0dGZ1bU00cDFPUGRyRVh2QUpSK1Vhd0RSU2RMN2NESk4ya2xabjBQaVJT?= =?utf-8?B?eFF3WFpKcCtaZ2t1TTNTb09lZ21SekUvSXBoRDVzRUhjWTl3QzNPa2RsUGY1?= =?utf-8?B?dEQ2VHZQdDA5MHVUUE8ydHdkcGZxRGVLcnZ0ZTU5bCtQK3hPRCtGc3NURXdG?= =?utf-8?B?YWVqamNuVlgzcWRHQ0JXeU1XeXFRVXQwbU9xS2J5c1hmRHM0M250LzFjV2V1?= =?utf-8?Q?qy5ddhwhGul89ZE921o2LgRDeB33UQV5tXdLWpUDzins=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 403546a2-f2d7-440a-d2be-08dbd92a8bd3 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0752.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2023 09:28:16.4223 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P193MB2276 X-Rspamd-Queue-Id: 9F4E11C0015 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4/pW5Nn tUi9PkA14wQ/OCyKthkC6ByMENpVUi6xbkBMfGAMMjxMoCJUChqdv9zTzf5aleWhdTSeToBp8n1uMACgh2QCZw9R3pNqSbnZPEl5MnRltCHnvMtK6UiKz/IpTVP0tgZNjCex7aRzBjfUJ+YD0kBnsiLktaqs8OAr3fKUXDgHwxweWGtq9yGqrTZ6NVimW78PJhvi3qhYGGlGq6cjVNrGkC72iseQk7fVy4PS+E8cZ95+I3Td1eY5oar932Vna5ljmB4qV0uWrHlPscl1BmVypKcrt9s9eD8Ic8pJM2aVoFwzW9cwId5X9g8qWfS8kPQKRoffNPUU5nN7fxnTpYBc8STFnJ9zSr2hleKpDvkS9AOXekkmkgtp91713u7sY4J7EspazgBxrsd1yY0khhhAvD4zULnhXs+/4AEpfHw1AXxzHW+ivcQS9OvH9mLEgmtM+ws2G4bPX/nhvJXh9eE0NZjKYH9u6OyZeWm+JpBeRFxGPZjrjbDBCUtaRC8bmjog5BOhENv+eevjCAdoNTsZIdAL+g63JrYgJG8iANM+ZAq+u5Oo+0mbeqMiQIoNF7ikAj4dktE64BfnMbzV/EJk6aIkNQSyV0Ty5CckIYsfJIf2VTM+q/DJc21fe+XWdxnQOEp6YMjYy1sT0enG/leDfW1l8FZC6sIYijhbW5tN6bv9mKY01OXAagn9KBidp1/YFKmPvT0Xh8ooSWXojSEfeE1SNH0YG/RIX3vclim4dKjWFOLyipW6TGE0C7XMmL0Zx47XfVEwZkgNMEhkAL+JtWami6A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.025057, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2023/10/30 14:29, Dmitry Vyukov wrote: > On Sun, 29 Oct 2023 at 10:05, Juntong Deng wrote: >> >> On 2023/10/26 3:22, Andrey Konovalov wrote: >>> On Tue, Oct 17, 2023 at 9:40 PM Juntong Deng wrote: >>>> >>>> The idea came from the bug I was fixing recently, >>>> 'KASAN: slab-use-after-free Read in tls_encrypt_done'. >>>> >>>> This bug is caused by subtle race condition, where the data structure >>>> is freed early on another CPU, resulting in use-after-free. >>>> >>>> Like this bug, some of the use-after-free bugs are caused by race >>>> condition, but it is not easy to quickly conclude that the cause of the >>>> use-after-free is race condition if only looking at the stack trace. >>>> >>>> I did not think this use-after-free was caused by race condition at the >>>> beginning, it took me some time to read the source code carefully and >>>> think about it to determine that it was caused by race condition. >>>> >>>> By adding timestamps for Allocation, Free, and Error to the KASAN >>>> report, it will be much easier to determine if use-after-free is >>>> caused by race condition. >>> >>> An alternative would be to add the CPU number to the alloc/free stack >>> traces. Something like: >>> >>> Allocated by task 42 on CPU 2: >>> (stack trace) >>> >>> The bad access stack trace already prints the CPU number. >> >> Yes, that is a great idea and the CPU number would help a lot. >> >> But I think the CPU number cannot completely replace the free timestamp, >> because some freeing really should be done at another CPU. >> >> We need the free timestamp to help us distinguish whether it was freed >> a long time ago or whether it was caused to be freed during the >> current operation. >> >> I think both the CPU number and the timestamp should be displayed, more >> information would help us find the real cause of the error faster. >> >> Should I implement these features? > > Hi Juntong, > > There is also an aspect of memory consumption. KASAN headers increase > 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 already > part of the header, but we removed them to shrink the header to 16 > bytes. > PID gives a good approximation of potential races. I usually look at > PIDs to understand if it's a "plain old single-threaded > use-after-free", or free and access happened in different threads. > Re timestamps, I see you referenced a syzbot report. With syzkaller > most timestamps will be very close even for non-racing case. > So if this is added, this should be added at least under a separate config. > > If you are looking for potential KASAN improvements, here is a good list: > https://bugzilla.kernel.org/buglist.cgi?bug_status=__open__&component=Sanitizers&list_id=1134168&product=Memory%20Management Hi Dmitry, I think PID cannot completely replace timestamp for reason similar to CPU number, some frees really should be done in another thread, but it is difficult for us to distinguish if it is a free that was done some time ago, or under subtle race conditions. As to whether most of the timestamps will be very close even for non-racing case, this I am not sure, because I do not have enough samples. I agree that these features should be in a separate config and the user should be free to choose whether to enable them or not. We can divide KASAN into normal mode and depth mode. Normal mode records only minimal critical information, while depth mode records more potentially useful information. Also, honestly, I think a small amount of extra memory consumption should not stop us from recording more information. Because if someone enables KASAN for debugging, then memory consumption and performance are no longer his main concern.