lkml.org 
[lkml]   [2023]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ext4: fix WARNING in lock_two_nondirectories
From
On 2023/12/25 10:49, Theodore Ts'o wrote:
> On Mon, Dec 25, 2023 at 10:33:20AM +0800, Baokun Li wrote:
>> Since in the current logic we update the boot loader file via
>> swap_inode_boot_loader(), however the boot loader inode on disk
>> may be uninitialized and may be garbage data, so we allow to get a
>> bad boot loader inode and then initialize it and swap it with the boot
>> loader file to be set.
>> When reinitializing the bad boot loader inode, something like an
>> inode type conversion may occur.
> Yes, but the boot laoder inode is *either* all zeros, or a regular
> file. If it's a directory, then it's a malicious syzbot trying to
> mess with our minds.
>
> Aside from the warning, it's pretty harmless, but it will very likely
> result in a corrupted file system --- but the file system was
> corrupted in the first place. So who cares?
>
> Just check to make sure that i_mode is either 0, or regular file, and
> return EFSCORRUPTEd, and we're done.
>
> - Ted
Yes, this seems to work, but for that matter, when i_mode is 0, we
still trigger the WARN_ON_ONCE in lock_two_nondirectories().

Merry Christmas!
--
With Best Regards,
Baokun Li
.

\
 
 \ /
  Last update: 2023-12-25 03:57    [W:0.093 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site