Re: [PATCH 1/4] ocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes

From: Joseph Qi

Date: Mon Aug 31 2026 - 22:15:08 EST




On 9/1/26 9:16 AM, Heming Zhao wrote:
> On Tue, Sep 01, 2026 at 09:08:26AM +0800, Joseph Qi wrote:
>>
>>
>> On 8/31/26 10:02 PM, Heming Zhao wrote:
>>> On Mon, Aug 31, 2026 at 02:28:45PM +0800, Joseph Qi wrote:
>>>> ocfs2_validate_inode_block() currently permits i_suballoc_slot to be
>>>> OCFS2_INVALID_SLOT for any dinode. Only system inodes created by
>>>> mkfs.ocfs2 are allocated from the global allocator and thus
>>>> legitimately carry this value; regular inodes are always allocated
>>>> from a per-slot suballocator and hence must have a valid slot.
>>>>
>>>> If a corrupted regular inode with OCFS2_INVALID_SLOT is accepted,
>>>> ocfs2_remove_inode() will pass the slot to ocfs2_get_system_file_inode()
>>>> and get_local_system_inode() will hit BUG_ON(slot == OCFS2_INVALID_SLOT)
>>>> when the inode is deleted. This can be triggered by an unprivileged
>>>> user unlinking such a corrupted file.
>>>>
>>>> Reject OCFS2_INVALID_SLOT for non-system dinodes during validation,
>>>> while still accepting it for system inodes.
>>>>
>>>> Fixes: fe7a283b3916 ("ocfs2: add suballoc slot check in ocfs2_validate_inode_block()")
>>>> Cc: stable@xxxxxxxxxxxxxxx
>>>> Signed-off-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>
>>>
>>> LGTM.
>>> Reviewed-by: Heming Zhao <heming.zhao@xxxxxxxx>
>>
>> Thanks, sashiko has some review comments, I'll fix them and send v2 later.
>>
>> Joseph
>
> It seems sashiko review comments only go to the patch submitter/author.
> In my view, they're also sent to ocfs2-devel@xxxxxxxxxxxxxxx, which is nice as
> it lets others on the list see them."
>

Yes, now it only sends to author and maintainers.
I'll send a patch to cc list as well.

Thanks,
Joseph