Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp401811pxb; Wed, 3 Mar 2021 06:16:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOvH51jgdjUxd/SCWpaJH879vxkQaLNNXVSgUp3Y3FIfmbt6pkfMyXqDdAviLBXFndTLVW X-Received: by 2002:a50:9ecf:: with SMTP id a73mr25177724edf.181.1614780964530; Wed, 03 Mar 2021 06:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614780964; cv=none; d=google.com; s=arc-20160816; b=fN4dcXljWQ1F0hBC/ywdIWyclWIALf+VxjBDSEjhW2gcdln8CfrRL5h9f/EbzMo7m+ YPFVNwu7WSlIpi/Pemj9AJk71WmH1nqpqc18g/7lIOdgLCuv5f2puVGZLevn78rMN0Xx Hfdk4CCz/fkrY5dQqL/w19XTZA+OlyNQ/np3TtdnEyoH2PyZ/jkvPCHqlQnblTzJDNp4 +8ucT+/DP0c+duTJZO7qAjlirAmsVoztNcPocnz315xwkYm8drt4WSIZeJbSp2Kx+H9m YqJ5W7DSiwBqVqhRfNROuhCKaF28yzpkJaBy4kIHVWHnxkKIt0fK3B+EjWBfvHGdhVU8 jyiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=swrh+yMoC3QelkDcW6ar6/omvGMIPtNavm+vyV0eGa4=; b=vdNh/eSTLjNA5vlVUk7UZNyc3SO/ezVedXHC16pzh6TkC8quCsylONiljaKgGTSbAO QhU8zXkEFHHq5fC8KVrqRxs53UThml2Soc7zGg1x+oy/BoSPyp04ngSCsiQ76SVDoo2r kpCwsVRw61NiVDKv7jXdnGI71Oq86SlgnLbiN8IdZBdPW932wrVqHSLNOIBAWipUgrO1 sHaDd5shGqRo6bncIaTIAgIK56jyTOYvDHzPaRQhVjdVpWYJ2AuGUv7FL2kqqScbuN0h CQSXgen/97ZUkwJ6KqKXFx2u9rkczyj3wIANyxbfTskCTyrFvKMHnRYidzdHksjSNiDt FgWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2c8ofpXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si13162611edt.78.2021.03.03.06.14.54; Wed, 03 Mar 2021 06:16:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2c8ofpXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237550AbhCAU67 (ORCPT + 99 others); Mon, 1 Mar 2021 15:58:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:37782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237283AbhCARLQ (ORCPT ); Mon, 1 Mar 2021 12:11:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B63F064ED0; Mon, 1 Mar 2021 16:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616976; bh=tL0qX8ULDxu04MSYKylduHXcbwhx6jNnI/xk/Zxd4+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2c8ofpXzDkbKACIIPHKVEgRYKQDxbp6iShGdA902x6FDYga3RXMv6iNoCaQJKKIYh GbXEDUAmck+4wNwpDSmahFnRpQG7QuP5Bchm1vpQeosqvm7E8VnmYUQecWzTS3S7Od rbeIk6dNXWQJtbRy8q9x71XMUAQHwdWi/HU5hLYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Jan Kara , Sasha Levin Subject: [PATCH 4.19 129/247] isofs: release buffer head before return Date: Mon, 1 Mar 2021 17:12:29 +0100 Message-Id: <20210301161037.990869006@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian [ Upstream commit 0a6dc67a6aa45f19bd4ff89b4f468fc50c4b8daa ] Release the buffer_head before returning error code in do_isofs_readdir() and isofs_find_entry(). Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem") Link: https://lore.kernel.org/r/20210118120455.118955-1-bianpan2016@163.com Signed-off-by: Pan Bian Signed-off-by: Jan Kara Signed-off-by: Sasha Levin --- fs/isofs/dir.c | 1 + fs/isofs/namei.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index 947ce22f5b3c3..55df4d80793ba 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c @@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file, printk(KERN_NOTICE "iso9660: Corrupted directory entry" " in block %lu of inode %lu\n", block, inode->i_ino); + brelse(bh); return -EIO; } diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c index cac468f04820e..558e7c51ce0d4 100644 --- a/fs/isofs/namei.c +++ b/fs/isofs/namei.c @@ -102,6 +102,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, printk(KERN_NOTICE "iso9660: Corrupted directory entry" " in block %lu of inode %lu\n", block, dir->i_ino); + brelse(bh); return 0; } -- 2.27.0