Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp543566ybe; Fri, 6 Sep 2019 03:34:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUOdY1HM+8tEbLGgrICKCWpruF5L4BZjg08D7j4f1XPKtB+Y2Lhh0NAIA/R/9dfLVllsZZ X-Received: by 2002:a17:902:be0c:: with SMTP id r12mr7967265pls.165.1567766060708; Fri, 06 Sep 2019 03:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567766060; cv=none; d=google.com; s=arc-20160816; b=HTF1FMp4O0yX96XIU9xYNcbYVFOuQGQ/dzpjtbzb8EMt/jVfNXPV6ckVB5Obp65kD1 uZph3AxWcgzNCHKpjLNQwbdls3t9ry8k/X76gZugSsa1KiPcMvcDt1K5fqrqULaGYrX0 PrzYYTHk9bkkTsHKBMg0uJIKYlkf+/W7zMJ4tfziByIKDhTNp++7C2+Ih0KvBjWCzCrp v90d7a1wzhMHhdUQ5QiNghlWtOj1J7jjrPccxAaSe/LMrpRuI0VCK7MHsSHqaOJKEWi9 vUjhCiNAMGPtjJl9al7vxdQhPhp3zUlX/eHQwDa9MuRGUSg3M+Sdab6SjYwz15jv50/t KJ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=r40OCDbZ/OnOJoAVBZvoLEch1OLsWF3BRv3RwiDta5A=; b=a8z9PuuyaaHgtXBBtvN5wlhhByHMyjFHj+sZP/8daBzDEv+S4CQ+5FCA2msRo8Ub6t 18U6HF+Hs7BOFAf5PdzbJ7RzeEOyc5WDkHCOije0Cs/5Q+2lP2pRFEYSWQ0xXT0hHC/N z80slF2/TXSlfQtwwUHdYrPiUkBOupROSX4tVz0/Y61LPMa1Eu0bnWWxPuOb7Z4N4Xwa rjrpTb6ghuEL+V7gGSPnXMgeYHeEira2qFHLCxbgfoIQ5ktADEAs3GrNE37kqGX56goY J6ZyjJGPjhvxvgStPCTd3wE995GgmHdvBOe4FHlRi2WuodQ/A542p4pIPF2d5Kckw6o+ xKqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si3926129pgi.127.2019.09.06.03.34.04; Fri, 06 Sep 2019 03:34:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388407AbfIFDPm (ORCPT + 99 others); Thu, 5 Sep 2019 23:15:42 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:25926 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731938AbfIFDPm (ORCPT ); Thu, 5 Sep 2019 23:15:42 -0400 X-UUID: 0c52a1504d08462fa88399dd2eb2bb08-20190906 X-UUID: 0c52a1504d08462fa88399dd2eb2bb08-20190906 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 791673129; Fri, 06 Sep 2019 11:15:34 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 6 Sep 2019 11:15:31 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 6 Sep 2019 11:15:31 +0800 Message-ID: <1567739734.32522.67.camel@mtksdccf07> Subject: Re: [PATCH 1/2] mm/kasan: dump alloc/free stack for page allocator From: Walter Wu To: Vlastimil Babka CC: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , "Martin Schwidefsky" , Arnd Bergmann , , , , , , Date: Fri, 6 Sep 2019 11:15:34 +0800 In-Reply-To: <99913463-0e2c-7dab-c1eb-8b9e149b3ee3@suse.cz> References: <20190904065133.20268-1-walter-zh.wu@mediatek.com> <401064ae-279d-bef3-a8d5-0fe155d0886d@suse.cz> <1567605965.32522.14.camel@mtksdccf07> <7998e8f1-e5e2-da84-ea1f-33e696015dce@suse.cz> <1567607063.32522.24.camel@mtksdccf07> <99913463-0e2c-7dab-c1eb-8b9e149b3ee3@suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-09-05 at 10:03 +0200, Vlastimil Babka wrote: > On 9/4/19 4:24 PM, Walter Wu wrote: > > On Wed, 2019-09-04 at 16:13 +0200, Vlastimil Babka wrote: > >> On 9/4/19 4:06 PM, Walter Wu wrote: > >> > >> The THP fix is not required for the rest of the series, it was even merged to > >> mainline separately. > >> > >>> And It looks like something is different, because we only need last > >>> stack of page, so it can decrease memory overhead. > >> > >> That would save you depot_stack_handle_t (which is u32) per page. I guess that's > >> nothing compared to KASAN overhead? > >> > > If we can use less memory, we can achieve what we want. Why not? > > In my experience to solve some UAFs, it's important to know not only the > freeing stack, but also the allocating stack. Do they make sense together, > or not? In some cases, even longer history of alloc/free would be nice :) > We think it only has free stack to find out the root cause. Maybe we can refer to other people's experience and ideas. > Also by simply recording the free stack in the existing depot handle, > you might confuse existing page_owner file consumers, who won't know > that this is a freeing stack. > Don't worry it. 1. Our feature option has this description about last stack of page. when consumer enable our feature, they should know the changing. 2. We add to print text message for alloc or free stack before dump the stack of page. so consumers should know what is it. > All that just doesn't seem to justify saving an u32 per page. Actually, We want to slim memory usage instead of increasing the memory usage at another mail discussion. Maybe, maintainer or reviewer can provide some ideas. That will be great. > > > > >