From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by kanga.kvack.org (Postfix) with ESMTP id 1629A2802C4 for ; Wed, 15 Jul 2015 19:53:31 -0400 (EDT) Received: by pachj5 with SMTP id hj5so32120134pac.3 for ; Wed, 15 Jul 2015 16:53:30 -0700 (PDT) Received: from mail-pd0-x22b.google.com (mail-pd0-x22b.google.com. [2607:f8b0:400e:c02::22b]) by mx.google.com with ESMTPS id re6si9942338pab.88.2015.07.15.16.53.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 16:53:30 -0700 (PDT) Received: by pdjr16 with SMTP id r16so33319582pdj.3 for ; Wed, 15 Jul 2015 16:53:30 -0700 (PDT) Date: Thu, 16 Jul 2015 08:53:35 +0900 From: Minchan Kim Subject: Re: [PATCH 1/2] mm/page_owner: fix possible access violation Message-ID: <20150715235335.GD988@bgram> References: <1436942039-16897-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436942039-16897-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joonsoo Kim On Wed, Jul 15, 2015 at 03:33:58PM +0900, Joonsoo Kim wrote: > When I tested my new patches, I found that page pointer which is used > for setting page_owner information is changed. This is because page > pointer is used to set new migratetype in loop. After this work, > page pointer could be out of bound. If this wrong pointer is used for > page_owner, access violation happens. Below is error message that I got. > > [ 6175.025217] BUG: unable to handle kernel paging request at 0000000000b00018 > [ 6175.026400] IP: [] save_stack_address+0x30/0x40 > [ 6175.027341] PGD 1af2d067 PUD 166e0067 PMD 0 > [ 6175.028129] Oops: 0002 [#1] SMP > snip... > [ 6175.055349] Call Trace: > [ 6175.055780] [] print_context_stack+0xcf/0x100 > [ 6175.056794] [] ? __module_text_address+0x12/0x70 > [ 6175.057848] [] dump_trace+0x15f/0x320 > [ 6175.058751] [] ? do_flush_tlb_all+0x50/0x50 > [ 6175.059732] [] ? smp_call_function_single+0xb9/0x120 > [ 6175.060856] [] save_stack_trace+0x2f/0x50 > [ 6175.061812] [] __set_page_owner+0x46/0x70 > [ 6175.062774] [] __isolate_free_page+0x1f7/0x210 > [ 6175.063804] [] split_free_page+0x21/0xb0 > [ 6175.064757] [] isolate_freepages_block+0x1e2/0x410 > [ 6175.065855] [] compaction_alloc+0x22d/0x2d0 > [ 6175.066850] [] migrate_pages+0x289/0x8b0 > [ 6175.067798] [] ? isolate_migratepages_block+0x28a/0x6e0 > [ 6175.068960] [] ? kmalloc_slab+0xa0/0xa0 > [ 6175.069892] [] ? ftrace_raw_event_mm_compaction_deplete_template+0xc0/0xc0 > [ 6175.071327] [] compact_zone+0x409/0x880 > [ 6175.072261] [] compact_zone_order+0x6d/0x90 > [ 6175.073250] [] try_to_compact_pages+0x110/0x210 > [ 6175.074297] [] __alloc_pages_direct_compact+0x3d/0xe6 > [ 6175.075427] [] __alloc_pages_nodemask+0x6cd/0x9a0 > [ 6175.076517] [] alloc_pages_current+0x91/0x100 > [ 6175.077545] [] runtest_store+0x296/0xa50 > [ 6175.078497] [] ? simple_strtoull+0x2c/0x50 > [ 6175.079465] [] simple_attr_write+0xbd/0xe0 > [ 6175.080458] [] __vfs_write+0x28/0xf0 > [ 6175.081349] [] ? __sb_start_write+0x49/0xf0 > [ 6175.082345] [] ? security_file_permission+0x45/0xd0 > [ 6175.083453] [] vfs_write+0xa9/0x1b0 > [ 6175.084334] [] SyS_write+0x46/0xb0 > [ 6175.085196] [] ? context_tracking_user_enter+0x13/0x20 > [ 6175.086339] [] ? syscall_trace_leave+0xa5/0x120 > [ 6175.087389] [] system_call_fastpath+0x16/0x75 > > This patch fixes this error by moving up set_page_owner(). > > Signed-off-by: Joonsoo Kim Acked-by: Minchan Kim -stable material? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org