lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z9kq744Q1zbbxOKH@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>
Date: Tue, 18 Mar 2025 13:42:31 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: "Theodore Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org, Jan Kara <jack@...e.cz>,
        Baokun Li <libaokun1@...wei.com>,
        Ritesh Harjani <ritesh.list@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: cache es->s_journal_inum in ext4_sb_info

On Sat, Mar 15, 2025 at 09:41:28PM -0400, Theodore Ts'o wrote:
> On Fri, Mar 14, 2025 at 05:11:43PM +0530, Ojaswin Mujoo wrote:
> > Currently, we access journal ino through sbi->s_es->s_journal_inum,
> > which directly reads from the ext4 sb buffer head. If someone modifies
> > this underneath us then the s_journal_inum field might get corrupted.
> > 
> > Although direct block device modifications can be expected to cause
> > issues in the FS, let's cache s_journal_inum in sbi->s_journal_ino so
> > our checks can be more resillient.
> 
> The reason why the block validity checks need to check against
> s_journal_ino is to exempt the lookups done by ext4_journal_bmap()
> from running afoul of the system zone checks, since the journal's data
> blocks are considered part of the system zone.
> 
> So this is something we need to do if the journal is actived, and if
> it's active, then sbi->s_journal will be non-NULL, and so we can just
> check to see if inode == sbi->s_journal instead.  This will simplify

I believe you mean inode == sbi->s_journal->j_inode here right?

since that is enough to confirm if we are called via ext4_journal_bmap
so we can avoid validity checks.

Regards,
ojaswin

> the code, without needing to expand the ext4_sb_info structure.
> 
> Cheers,
> 
> 						- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ