All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 0/3] ext4: Create EA inodes outside of buffer lock
Date: Fri,  9 Feb 2024 12:20:58 +0100	[thread overview]
Message-ID: <20240209111418.22308-1-jack@suse.cz> (raw)

Hello,

ext4_xattr_set_entry() creates new EA inodes while holding buffer lock on the
external xattr block. This is problematic as it nests all the allocation
locking (which acquires locks on other buffers) under the buffer lock. This can
even deadlock when the filesystem is corrupted and e.g. quota file is setup to
contain xattr block as data block as syzbot has spotted. This series moves
the allocation of EA inode to happen outside of the buffer lock which is
generally more sensible and also fixes the syzbot reproducer.

								Honza

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 0/2 v2] ext4: Create EA inodes outside of buffer lock
Date: Thu, 21 Mar 2024 17:26:48 +0100	[thread overview]
Message-ID: <20240209111418.22308-1-jack@suse.cz> (raw)
Message-ID: <20240321162648.KjVFwbImPO---JzvbzSY6qGFqEJrUGmC-O-8QualfHE@z> (raw)

Hello,

ext4_xattr_set_entry() creates new EA inodes while holding buffer lock on the
external xattr block. This is problematic as it nests all the allocation
locking (which acquires locks on other buffers) under the buffer lock. This can
even deadlock when the filesystem is corrupted and e.g. quota file is setup to
contain xattr block as data block as syzbot has spotted. This series moves
the allocation of EA inode to happen outside of the buffer lock which is
generally more sensible and also fixes the syzbot reproducer.

Changes since v1:
* Rebased on top of Linus' tree as of March 21 - which meant dropping one
  already merged patch and reverting one as well.
* Fixed EA inode refcount leak

								Honza

             reply	other threads:[~2024-02-09 11:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 11:20 Jan Kara [this message]
2024-03-21 16:26 ` [PATCH 0/2 v2] ext4: Create EA inodes outside of buffer lock Jan Kara
2024-02-09 11:20 ` [PATCH 1/3] ext4: Fold quota accounting into ext4_xattr_inode_lookup_create() Jan Kara
2024-02-09 11:21 ` [PATCH 2/3] ext4: Do not create EA inode under buffer lock Jan Kara
2024-02-29 15:59   ` Theodore Ts'o
2024-03-14 18:12     ` Jan Kara
2024-02-09 11:21 ` [PATCH 3/3] ext4: Drop duplicate ea_inode handling in ext4_xattr_block_set() Jan Kara
2024-02-22 15:54 ` [PATCH 0/3] ext4: Create EA inodes outside of buffer lock Theodore Ts'o
2024-03-21 16:26 ` [PATCH 1/2] Revert "ext4: drop duplicate ea_inode handling in ext4_xattr_block_set()" Jan Kara
2024-05-03  4:02   ` Theodore Ts'o
2024-03-21 16:26 ` [PATCH 2/2] ext4: Do not create EA inode under buffer lock Jan Kara
2024-03-22 18:06   ` Andreas Dilger
2024-03-25 19:03     ` Jan Kara
2024-05-03  4:03   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240209111418.22308-1-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.