From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752870AbcGDF0m (ORCPT ); Mon, 4 Jul 2016 01:26:42 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:49736 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752588AbcGDF0k (ORCPT ); Mon, 4 Jul 2016 01:26:40 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Mon, 4 Jul 2016 14:29:55 +0900 From: Joonsoo Kim To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Andrew Morton , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm/page_owner: track page free call chain Message-ID: <20160704052955.GD14840@js1304-P5Q-DELUXE> References: <20160702161656.14071-1-sergey.senozhatsky@gmail.com> <20160702161656.14071-4-sergey.senozhatsky@gmail.com> <20160704045714.GC14840@js1304-P5Q-DELUXE> <20160704050730.GC898@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160704050730.GC898@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 04, 2016 at 02:07:30PM +0900, Sergey Senozhatsky wrote: > Hello, > > On (07/04/16 13:57), Joonsoo Kim wrote: > > On Sun, Jul 03, 2016 at 01:16:56AM +0900, Sergey Senozhatsky wrote: > > > Introduce PAGE_OWNER_TRACK_FREE config option to extend page owner with > > > free_pages() tracking functionality. This adds to the dump_page_owner() > > > output an additional backtrace, that tells us what path has freed the > > > page. > > > > Hmm... Do you have other ideas to use this feature? Following example is > > just to detect use-after-free and we have other good tools for it > > (KASAN or DEBUG_PAGEALLOC) so I'm not sure whether it's useful or not. > > there is no kasan for ARM32, for example (apart from the fact that > it's really hard to use kasan sometimes due to its cpu cycles and > memory requirements). Hmm... for debugging purpose, KASAN provides many more things so IMO it's better to implement/support KASAN in ARM32 rather than expand PAGE_OWNER for free. > > educate me, will DEBUG_PAGEALLOC tell us what path has triggered the > extra put_page()? hm... does ARM32 provide ARCH_SUPPORTS_DEBUG_PAGEALLOC? Hmm... Now, I notice that PAGE_OWNER_TRACK_FREE will detect double-free rather than use-after-free. DEBUG_PAGEALLOC doesn't catch double-free but it can be implemented easily. In this case, we can show call path for second free. AFAIK, ARM32 doesn't support ARCH_SUPPORTS_DEBUG_PAGEALLOC. Thanks.