From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F2EC43381 for ; Tue, 26 Mar 2019 06:38:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FD942086C for ; Tue, 26 Mar 2019 06:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553582302; bh=V7hmJkV+/F95Ru0uHHTSvJfuwHDhMzntCi75k/+SB3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HG43ps/WRiRPfabb38c+jpcbuKPZCaNfvjp7yaowJHJThMV8iMt9mPIgHVieufIIl zVA4OAnf7z5Z1jsRc4YsuNwKJ1J20m0yn8N1IVAo5IFJVt+Y/vtOSqHglVAplSulun bmBmoiVeoMocWt4+SbPQjhyEc1c5zIexy/oXI4g4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732521AbfCZGiU (ORCPT ); Tue, 26 Mar 2019 02:38:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730133AbfCZGiR (ORCPT ); Tue, 26 Mar 2019 02:38:17 -0400 Received: from localhost (unknown [104.132.152.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 718642086C; Tue, 26 Mar 2019 06:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553582297; bh=V7hmJkV+/F95Ru0uHHTSvJfuwHDhMzntCi75k/+SB3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tii8HextkUN8WSNytSvdiMqXxDwri+lPV84q4/6rzqfOzYlVsrL5RubEjxI2ZzSDD vcBsYtUurDkzo+uo/s3BNyGezfGsufJCn88Xaf3M/e3VcDlpba4WdACmxmNq4vR2JS CusbY8Ge47JW0wyWEqYaM2FR9Sud7AX+31xMsRHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, jean-luc malet , Jan Kara Subject: [PATCH 5.0 13/52] udf: Fix crash on IO error during truncate Date: Tue, 26 Mar 2019 15:30:00 +0900 Message-Id: <20190326042701.589643019@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190326042700.963224437@linuxfoundation.org> References: <20190326042700.963224437@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jan Kara commit d3ca4651d05c0ff7259d087d8c949bcf3e14fb46 upstream. When truncate(2) hits IO error when reading indirect extent block the code just bugs with: kernel BUG at linux-4.15.0/fs/udf/truncate.c:249! ... Fix the problem by bailing out cleanly in case of IO error. CC: stable@vger.kernel.org Reported-by: jean-luc malet Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/udf/truncate.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/udf/truncate.c +++ b/fs/udf/truncate.c @@ -260,6 +260,9 @@ void udf_truncate_extents(struct inode * epos.block = eloc; epos.bh = udf_tread(sb, udf_get_lb_pblock(sb, &eloc, 0)); + /* Error reading indirect block? */ + if (!epos.bh) + return; if (elen) indirect_ext_len = (elen + sb->s_blocksize - 1) >>