[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0580422d0d8059b4b5303e56e18700539dda39a.camel@ibm.com>
Date: Thu, 31 Jul 2025 18:03:22 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "leocstone@...il.com" <leocstone@...il.com>,
"jack@...e.cz"
<jack@...e.cz>,
"penguin-kernel@...ove.SAKURA.ne.jp"
<penguin-kernel@...ove.SAKURA.ne.jp>,
"willy@...radead.org"
<willy@...radead.org>,
"brauner@...nel.org" <brauner@...nel.org>
CC: "glaubitz@...sik.fu-berlin.de" <glaubitz@...sik.fu-berlin.de>,
"frank.li@...o.com" <frank.li@...o.com>,
"slava@...eyko.com"
<slava@...eyko.com>,
"linux-fsdevel@...r.kernel.org"
<linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org"
<akpm@...ux-foundation.org>
Subject: RE: [PATCH v4] hfs: update sanity check of the root record
On Thu, 2025-07-31 at 07:02 +0900, Tetsuo Handa wrote:
> On 2025/07/31 4:24, Viacheslav Dubeyko wrote:
> > If we considering case HFS_CDR_DIR in hfs_read_inode(), then we know that it
> > could be HFS_POR_CNID, HFS_ROOT_CNID, or >= HFS_FIRSTUSER_CNID. Do you mean that
> > HFS_POR_CNID could be a problem in hfs_write_inode()?
>
> Yes. Passing one of 1, 5 or 15 instead of 2 from hfs_fill_super() triggers BUG()
> in hfs_write_inode(). We *MUST* validate at hfs_fill_super(), or hfs_read_inode()
> shall have to also reject 1, 5 and 15 (and as a result only accept 2).
The fix should be in hfs_read_inode(). Currently, suggested solution hides the
issue but not fix the problem. Because b-tree nodes could contain multiple
corrupted records. Now, this patch checks only record for root folder. Let's
imagine that root folder record will be OK but another record(s) will be
corrupted in such way. Finally, we will have successful mount but operation with
corrupted record(s) will trigger this issue. So, I cannot consider this patch as
a complete fix of the problem.
Thanks,
Slava.
Powered by blists - more mailing lists