From patchwork Mon Nov 18 05:53:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Yue X-Patchwork-Id: 11248897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9DB51593 for ; Mon, 18 Nov 2019 05:54:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9A5F2073A for ; Mon, 18 Nov 2019 05:54:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BC/NIE3w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbfKRFxo (ORCPT ); Mon, 18 Nov 2019 00:53:44 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40369 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbfKRFxo (ORCPT ); Mon, 18 Nov 2019 00:53:44 -0500 Received: by mail-pg1-f196.google.com with SMTP id e17so1720181pgd.7 for ; Sun, 17 Nov 2019 21:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a6dIah2qpSX7JdrW3yFwHDO6VBb4FkBSlKIz0MB1VVg=; b=BC/NIE3wtRjlKTwpdnGoKpAhnQAf62F9nTLLtwtNTVMpId05oYyg+ZjUfrN0DkQ1+q 3lBiy11RCHj3KwD0COicXHLi2mQ7mCK5iGCLcVqhrUyJZkB7ERE943pOBUtm3uv+G5g5 zmvysgXGDx7Vx1u6xn5fN+0sGFsRCc8+XVuLPQ10LUOhjjrtRvWX7ltg5qZFhOL82htR jEnkq0Wy7YUgAGpLKCohpjIK2KB8QEk3dUn7n0BwOt7OXu11wmfPyuLJyho33Wn27IBG fAhrApYkNHL/kTcaD4GWPqWEblLn0RXVXc5z52j7TchA6xzB1aCLMGcHYnkjB4IAcW4P Q9Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a6dIah2qpSX7JdrW3yFwHDO6VBb4FkBSlKIz0MB1VVg=; b=pWnu0DBsOPR6i6bbuBXgPgR3yJYpF2fzxzqtYFDF779GE0sj+NXQ6Zrb0v+uOjSVGZ umfg13O/x/DjFrsfHaPCGyozRR4LTik/244eMh0/mmApW1BRXmgQM5cVkTLowh+nU7b4 TKS4a0cfG152Lj12MUWJ5X7QKsK6vNXwbRR2L37FOJDPdoNoBQU3Bc0x8S6p8Aj4JVHL FQPbS7M3TQQoRU3jrwPsgpBT1jXxKdnSh3lrAY060C2vmUrIamOjqQdqwPocL0rsgGaP OVILcXMW4Iz5wL9b8af4RP+tcl003369eeHstSanQv6Mr1rOszNdIGx0SCHn2QFAfQei eFIw== X-Gm-Message-State: APjAAAXFuXiqdAazt+fskUDnxSIO7ersBu/uhXI7+bza9oq8e3kh5C0H G5hE2gZDpa4I7/4pp9iX34ovs0iBBKI= X-Google-Smtp-Source: APXvYqzCovcXqVow4NVZ+t3W1aqrnrP/wjGy5CCjZ0QeCfIQHmgO7Kj633vZTByMFB8PuLxvpa2Ofw== X-Received: by 2002:a63:6742:: with SMTP id b63mr8276441pgc.24.1574056423244; Sun, 17 Nov 2019 21:53:43 -0800 (PST) Received: from cat-arch.lan (95.246.92.34.bc.googleusercontent.com. [34.92.246.95]) by smtp.gmail.com with ESMTPSA id n62sm19838775pjc.6.2019.11.17.21.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 21:53:42 -0800 (PST) From: damenly.su@gmail.com X-Google-Original-From: Damenly_Su@gmx.com To: linux-btrfs@vger.kernel.org Cc: Damenly_Su@gmx.com Subject: [PATCH 2/2] btrfs-progs: fuzz-tests: add image trigers abort of open_ctree() Date: Mon, 18 Nov 2019 13:53:35 +0800 Message-Id: <20191118055335.9927-2-Damenly_Su@gmx.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191118055335.9927-1-Damenly_Su@gmx.com> References: <20191118055335.9927-1-Damenly_Su@gmx.com> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Su Yue This test case contains a bad block of dev tree and trigers abort while open_ctree() due to its exquisite chunk layout. It can't be repaired by fsck, so put it into fuzz-tests/images. The image is provided by Ruud van Asseldonk. This commit just did xz and writes the record. Link: https://github.com/kdave/btrfs-progs/issues/210 Signed-off-by: Su Yue --- .../images/bad-dev-tree-node.raw.txt | 58 ++++++++++++++++++ .../images/bad-dev-tree-node.raw.xz | Bin 0 -> 18788 bytes 2 files changed, 58 insertions(+) create mode 100644 tests/fuzz-tests/images/bad-dev-tree-node.raw.txt create mode 100644 tests/fuzz-tests/images/bad-dev-tree-node.raw.xz GIT binary patch literal 18788 zcmeHPc{J4h{-24+I+0yyY+1u-lC6;^MAnSP*q4x^$oh;mOLjB1hOvi|ks?b8i6M-& zM3O97AF@P3nA?5sz2`aioZs*M?%exSe&>Aun=}7>&Ut@c@7MSBe!btH_l^?A+yVrm zogS#v-Uot$4}(CUgFWV*6pARVtu+XAZHGcBsG;bbI?H)o+1})Fvcz=3P5RBnNx`sJ zaxE%q;B)1{?Xj^2as@0yA$LB+i?ErFp?O+-Vki7Is#8OlFE_sT*1c$TyXZ~my4Nc{ z55CvVVZz!3(<{)>ub^>PzfWZdC+TH^lcx{d_!>TfBK1p5m5nN0rcC&6FE=H+c4vLKq3WtD4o#`=LnVu~TrF zC9hm>9DAt>O@wF_XGuuRDV?mSM==fg$ZYGg;i>lEtW-sY$tSrVEcv%3G!@9tvTX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