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  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]
Date:   Fri, 12 Jun 2020 14:52:07 -0400
From:   "Theodore Y. Ts'o" <tytso@....edu>
To:     Jan Kara <jack@...e.cz>
Cc:     "zhangyi (F)" <yi.zhang@...wei.com>, linux-ext4@...r.kernel.org,
        adilger.kernel@...ger.ca, zhangxiaoxu5@...wei.com
Subject: Re: [PATCH v2] ext4, jbd2: ensure panic by fix a race between jbd2
 abort and ext4 error handlers

On Tue, Jun 09, 2020 at 01:50:26PM +0200, Jan Kara wrote:
> On Tue 09-06-20 15:35:40, zhangyi (F) wrote:
> > In the ext4 filesystem with errors=panic, if one process is recording
> > errno in the superblock when invoking jbd2_journal_abort() due to some
> > error cases, it could be raced by another __ext4_abort() which is
> > setting the SB_RDONLY flag but missing panic because errno has not been
> > recorded.
> > 
> > jbd2_journal_commit_transaction()
> >  jbd2_journal_abort()
> >   journal->j_flags |= JBD2_ABORT;
> >   jbd2_journal_update_sb_errno()
> >                                     | ext4_journal_check_start()
> >                                     |  __ext4_abort()
> >                                     |   sb->s_flags |= SB_RDONLY;
> >                                     |   if (!JBD2_REC_ERR)
> >                                     |        return;
> >   journal->j_flags |= JBD2_REC_ERR;
> > 
> > Finally, it will no longer trigger panic because the filesystem has
> > already been set read-only. Fix this by introduce j_abort_mutex to make
> > sure journal abort is completed before panic, and remove JBD2_REC_ERR
> > flag.
> > 
> > Fixes: 4327ba52afd03 ("ext4, jbd2: ensure entering into panic after recording an error in superblock")
> > Signed-off-by: zhangyi (F) <yi.zhang@...wei.com>
> > Cc: <stable@...r.kernel.org>
> 
> Great, thanks! The patch looks good to me. You can add:
> 
> Reviewed-by: Jan Kara <jack@...e.cz>

Applied, thanks.

						- Ted

Powered by blists - more mailing lists