From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Ernesto A. Fernández" <ernesto.mnd.fernandez@gmail.com>,
"Christoph Hellwig" <hch@infradead.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Sasha Levin" <sashal@kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 095/150] hfsplus: fix BUG on bnode parent update
Date: Sat, 16 Nov 2019 10:46:33 -0500 [thread overview]
Message-ID: <20191116154729.9573-95-sashal@kernel.org> (raw)
In-Reply-To: <20191116154729.9573-1-sashal@kernel.org>
From: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
[ Upstream commit 19a9d0f1acf75e8be8cfba19c1a34e941846fa2b ]
Creating, renaming or deleting a file may hit BUG_ON() if the first
record of both a leaf node and its parent are changed, and if this
forces the parent to be split. This bug is triggered by xfstests
generic/027, somewhat rarely; here is a more reliable reproducer:
truncate -s 50M fs.iso
mkfs.hfsplus fs.iso
mount fs.iso /mnt
i=1000
while [ $i -le 2400 ]; do
touch /mnt/$i &>/dev/null
((++i))
done
i=2400
while [ $i -ge 1000 ]; do
mv /mnt/$i /mnt/$(perl -e "print $i x61") &>/dev/null
((--i))
done
The issue is that a newly created bnode is being put twice. Reset
new_node to NULL in hfs_brec_update_parent() before reaching goto again.
Link: http://lkml.kernel.org/r/5ee1db09b60373a15890f6a7c835d00e76bf601d.1535682461.git.ernesto.mnd.fernandez@gmail.com
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/hfsplus/brec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index d3f36982f6858..0f53a486d2c18 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -448,6 +448,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
/* restore search_key */
hfs_bnode_read_key(node, fd->search_key, 14);
}
+ new_node = NULL;
}
if (!rec && node->parent)
--
2.20.1
next prev parent reply other threads:[~2019-11-16 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191116154729.9573-1-sashal@kernel.org>
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 088/150] vfs: avoid problematic remapping requests into partial EOF block Sasha Levin
2019-11-16 15:46 ` Sasha Levin [this message]
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 096/150] hfs: fix BUG on bnode parent update Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 097/150] hfsplus: prevent btree data loss on ENOSPC Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 098/150] hfs: " Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 099/150] hfsplus: fix return value of hfsplus_get_block() Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 100/150] hfs: fix return value of hfs_get_block() Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 101/150] hfsplus: update timestamps on truncate() Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 102/150] hfs: update timestamp " Sasha Levin
2019-11-16 15:46 ` [PATCH AUTOSEL 4.14 103/150] fs/hfs/extent.c: fix array out of bounds read of array extent Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191116154729.9573-95-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ernesto.mnd.fernandez@gmail.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).