From: Andrew Morton <akpm@linux-foundation.org>
To: Simon Gander <simon@tuxera.com>
Cc: <linux-fsdevel@vger.kernel.org>, Anton Altaparmakov <anton@tuxera.com>
Subject: Re: [PATCH] hfsplus: Fix crash and filesystem corruption when deleting files
Date: Sat, 28 Mar 2020 16:14:39 -0700 [thread overview]
Message-ID: <20200328161439.d38f14698fe7b5671eada4a5@linux-foundation.org> (raw)
In-Reply-To: <20200327155541.1521-1-simon@tuxera.com>
On Fri, 27 Mar 2020 16:55:40 +0100 Simon Gander <simon@tuxera.com> wrote:
> When removing files containing extended attributes, the hfsplus driver
> may remove the wrong entries from the attributes b-tree, causing major
> filesystem damage and in some cases even kernel crashes.
>
> To remove a file, all its extended attributes have to be removed as well.
> The driver does this by looking up all keys in the attributes b-tree with
> the cnid of the file. Each of these entries then gets deleted using the
> key used for searching, which doesn't contain the attribute's name when it
> should. Since the key doesn't contain the name, the deletion routine will
> not find the correct entry and instead remove the one in front of it. If
> parent nodes have to be modified, these become corrupt as well. This causes
> invalid links and unsorted entries that not even macOS's fsck_hfs is able
> to fix.
>
> To fix this, modify the search key before an entry is deleted from the
> attributes b-tree by copying the found entry's key into the search key,
> therefore ensuring that the correct entry gets removed from the tree.
>
This seems fairly important. Should it have a cc:stable?
next prev parent reply other threads:[~2020-03-28 23:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 15:55 [PATCH] hfsplus: Fix crash and filesystem corruption when deleting files Simon Gander
2020-03-28 23:14 ` Andrew Morton [this message]
2020-03-28 23:18 ` Anton Altaparmakov
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=20200328161439.d38f14698fe7b5671eada4a5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=anton@tuxera.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=simon@tuxera.com \
/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).