From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 16 01:51:33 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFEC0BF8 for ; Thu, 16 Apr 2015 01:51:33 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBBDD692 for ; Thu, 16 Apr 2015 01:51:33 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3G1pXft064071 for ; Thu, 16 Apr 2015 01:51:33 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 199476] [patch] panic when geom_uncompress tastes large filesystems Date: Thu, 16 Apr 2015 01:51:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kwhite@site.uottawa.ca X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 01:51:34 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199476 Bug ID: 199476 Summary: [patch] panic when geom_uncompress tastes large filesystems Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: kwhite@site.uottawa.ca Keywords: patch Created attachment 155638 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=155638&action=edit patch to fix panic when tasting large compressed filesystems geom_uncompress reads the header and all block offsets with a single g_read_data() request. This will fail (panic) if the total data requested is greater then MAXPHYS. i.e. when the total number of block offsets approaches MAXPHYS / sizeof(uint64). The attached patch changes the method of getting the block offsets to be the same as that used by geom_uzip: sector by sector. Patch attached. Typical panic (please excuse transcription errors): # kldload geom_uncompress md0.uncompress: GEOM_UZIP image found panic: g_read_data(): invalid length 290816 cpuid = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00932a59c0 vpanic() at vpanic+0x189/frame 0xfffffe00932a5a40 kassert_panic() at kassert_panic+0x132/frame 0xffffe00932a5ab0 g_read_data() at g_read_data+0x45/frame 0xffffe00932a5af0 g_uncompress_taste() at g_uncompress_taste_0x30d/frame 0xfffffe00932a5b40 g_load_class() at g_load_class+0x1cc/frame 0xfffffe00932a5b70 g_run_events() at g_run_events_0x1a7/frame 0xfffffe00932a5bb0 fork_exit() at fork_exit+0x84/frame 0xfffffe00932a5bf0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00932a5bf0 --- trap 0, rip = 0, rsp = 0xfffffe00932a5cb0, rbp = 0 --- KDB: enter: panic [ thread pid 13 tid 100013 ] Stopped at kdb_enter+0x3e: movq $0,kdb_why db> -- You are receiving this mail because: You are the assignee for the bug.