From patchwork Fri Nov 27 11:07:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 7712741 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92523BF90C for ; Fri, 27 Nov 2015 11:07:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6172E2066A for ; Fri, 27 Nov 2015 11:07:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3567620567 for ; Fri, 27 Nov 2015 11:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754737AbbK0LHS (ORCPT ); Fri, 27 Nov 2015 06:07:18 -0500 Received: from mail-ig0-f174.google.com ([209.85.213.174]:36294 "EHLO mail-ig0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754576AbbK0LHP convert rfc822-to-8bit (ORCPT ); Fri, 27 Nov 2015 06:07:15 -0500 Received: by igcph11 with SMTP id ph11so25471828igc.1; Fri, 27 Nov 2015 03:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=hSvMZA1Ns+rlHdavTT6+YWH3PQVtnTRhw4gTdbUHBfE=; b=Y+RLtbvu/SFJg0eqdzdO+5JklJTrAHZYVd7QMDTbaDikgkzgSa7C+U/XZPaDr4spOP AakwCelpvGKr3bmfh2sp7s951Nt5rO5CJDSIC3Ncb88UMs4FJPLrxSx2nVjE6ZJ4sFNT XAioUXYLdsY7ItcoJZVVsQwHWbg04OGI8GPnZeUYPybx5P+pbB0cJXPrxXtAGV2bUMYF prUPTa3FBJGYzHo3d1J8FUyOUWeHFLgb0YmZkgDubd6ouvgr6u3Wb/qVCrgW9p7Jl9HX wuoRvoFowthSg7mnzcRCgl8XTUyGZ7Bb78OasbCiBQiBsMxuM207KuHndBaWu60cxYel xf4w== MIME-Version: 1.0 X-Received: by 10.50.90.180 with SMTP id bx20mr558087igb.9.1448622434416; Fri, 27 Nov 2015 03:07:14 -0800 (PST) Received: by 10.36.193.129 with HTTP; Fri, 27 Nov 2015 03:07:14 -0800 (PST) Reply-To: fdmanana@gmail.com In-Reply-To: <565834B3.4020602@gmx.de> References: <565834B3.4020602@gmx.de> Date: Fri, 27 Nov 2015 11:07:14 +0000 Message-ID: Subject: Re: PAX: size overflow detected in function try_merge_map fs/btrfs/extent_map.c:238 From: Filipe Manana To: =?UTF-8?Q?Toralf_F=C3=B6rster?= Cc: "linux-btrfs@vger.kernel.org" , Linux Kernel Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Nov 27, 2015 at 10:47 AM, Toralf Förster wrote: > Happened today few times in a row at a stable 64 bit Gentoo hardened system: > > > > Nov 27 10:23:09 t44 kernel: [41619.519921] PAX: size overflow detected in function try_merge_map fs/btrfs/extent_map.c:238 cicus.107_102 max, count: 13, decl: block_len; num: 0; context: extent_map; > Nov 27 10:23:09 t44 kernel: [41619.519929] CPU: 2 PID: 3361 Comm: host_jskwgen Tainted: G W 4.2.6-hardened-r6 #3 > Nov 27 10:23:09 t44 kernel: [41619.519932] Hardware name: LENOVO 20AQCTO1WW/20AQCTO1WW, BIOS GJET83WW (2.33 ) 03/09/2015 > Nov 27 10:23:09 t44 kernel: [41619.519934] ffffffff81831343 0000000000000000 ffffffff8183132d ffffc9000298b6e8 > Nov 27 10:23:09 t44 kernel: [41619.519939] ffffffff815ee0ea ffff88033e30eec8 ffffffff81831343 ffffc9000298b718 > Nov 27 10:23:09 t44 kernel: [41619.519943] ffffffff811ade1b ffff8802fb611480 ffff88032b717510 ffff88032b74fae0 > Nov 27 10:23:09 t44 kernel: [41619.519946] Call Trace: > Nov 27 10:23:09 t44 kernel: [41619.519955] [] dump_stack+0x45/0x5d > Nov 27 10:23:09 t44 kernel: [41619.519959] [] report_size_overflow+0x3b/0x50 > Nov 27 10:23:09 t44 kernel: [41619.519963] [] try_merge_map+0x1f1/0x310 > Nov 27 10:23:09 t44 kernel: [41619.519966] [] add_extent_mapping+0x132/0x1c0 > Nov 27 10:23:09 t44 kernel: [41619.519968] [] btrfs_get_extent+0x659/0xdd0 > Nov 27 10:23:09 t44 kernel: [41619.519972] [] ? kmem_cache_alloc+0x32/0x140 > Nov 27 10:23:09 t44 kernel: [41619.519975] [] __do_readpage+0x6f2/0xc30 > Nov 27 10:23:09 t44 kernel: [41619.519977] [] ? __set_extent_bit+0x14e/0x580 > Nov 27 10:23:09 t44 kernel: [41619.519979] [] ? btrfs_real_readdir+0x6f0/0x6f0 > Nov 27 10:23:09 t44 kernel: [41619.519983] [] ? _raw_spin_unlock_irq+0x19/0x30 > Nov 27 10:23:09 t44 kernel: [41619.519985] [] ? btrfs_lookup_ordered_extent+0xa2/0xe0 > Nov 27 10:23:09 t44 kernel: [41619.519987] [] __extent_read_full_page+0x1d6/0x210 > Nov 27 10:23:09 t44 kernel: [41619.519989] [] ? btrfs_real_readdir+0x6f0/0x6f0 > Nov 27 10:23:09 t44 kernel: [41619.519991] [] ? btrfs_real_readdir+0x6f0/0x6f0 > Nov 27 10:23:09 t44 kernel: [41619.519993] [] extent_read_full_page+0x4f/0x80 > Nov 27 10:23:09 t44 kernel: [41619.519997] [] ? lru_cache_add+0x19/0x30 > Nov 27 10:23:09 t44 kernel: [41619.519999] [] ? inode_tree_add+0x150/0x150 > Nov 27 10:23:09 t44 kernel: [41619.520000] [] btrfs_readpage+0x34/0x50 > Nov 27 10:23:09 t44 kernel: [41619.520002] [] ? inode_tree_add+0x150/0x150 > Nov 27 10:23:09 t44 kernel: [41619.520004] [] do_read_cache_page+0x99/0x1b0 > Nov 27 10:23:09 t44 kernel: [41619.520006] [] ? inode_tree_add+0x150/0x150 > Nov 27 10:23:09 t44 kernel: [41619.520008] [] ? inode_tree_add+0x150/0x150 > Nov 27 10:23:09 t44 kernel: [41619.520009] [] read_cache_page+0x38/0x50 > Nov 27 10:23:09 t44 kernel: [41619.520012] [] page_getlink.isra.48.constprop.51+0x3a/0xa0 > Nov 27 10:23:09 t44 kernel: [41619.520014] [] page_follow_link_light+0x2b/0x50 > Nov 27 10:23:09 t44 kernel: [41619.520016] [] trailing_symlink+0x27f/0x2b0 > Nov 27 10:23:09 t44 kernel: [41619.520019] [] path_openat+0x16b/0x1700 > Nov 27 10:23:09 t44 kernel: [41619.520021] [] do_filp_open+0x81/0xf0 > Nov 27 10:23:09 t44 kernel: [41619.520024] [] do_sys_open+0x133/0x280 > Nov 27 10:23:09 t44 kernel: [41619.520026] [] SyS_open+0x31/0x50 > Nov 27 10:23:09 t44 kernel: [41619.520028] [] entry_SYSCALL_64_fastpath+0x12/0x83 Try the following (also pasted at https://friendpaste.com/5O6o1cqWqJZDIKrH1YqG7y): merge->mod_start; em->mod_start = merge->mod_start; @@ -252,7 +253,8 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em) merge = rb_entry(rb, struct extent_map, rb_node); if (rb && mergable_maps(em, merge)) { em->len += merge->len; - em->block_len += merge->block_len; + if (em->block_start != EXTENT_MAP_HOLE) + em->block_len += merge->block_len; rb_erase(&merge->rb_node, &tree->map); RB_CLEAR_NODE(&merge->rb_node); em->mod_len = (merge->mod_start + merge->mod_len) - em->mod_start; > > > Furthermore neither login into the KDE screen saver nor login at the console could be made, sys-rq keys didn't worked - power off was my friend. > > > > -- > Toralf, pgp: C4EACDDE 0076E94E > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 6a98bdd..26b4c13 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -235,7 +235,8 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em) em->start = merge->start; em->orig_start = merge->orig_start; em->len += merge->len; - em->block_len += merge->block_len; + if (em->block_start != EXTENT_MAP_HOLE) + em->block_len += merge->block_len; em->block_start = merge->block_start; em->mod_len = (em->mod_len + em->mod_start) -