<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4/fast_commit.c, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-10-06T02:32:15Z</updated>
<entry>
<title>ext4: make state in ext4_mb_mark_bb to be bool</title>
<updated>2023-10-06T02:32:15Z</updated>
<author>
<name>Kemeng Shi</name>
<email>shikemeng@huaweicloud.com</email>
</author>
<published>2023-09-28T16:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d2f7cf40ea89b486fb7a25f5ab9a5d3ce26fb4bb'/>
<id>urn:sha1:d2f7cf40ea89b486fb7a25f5ab9a5d3ce26fb4bb</id>
<content type='text'>
As state could only be either 0 or 1, just make it bool.

Signed-off-by: Kemeng Shi &lt;shikemeng@huaweicloud.com&gt;
Reviewed-by: "Ritesh Harjani (IBM)" &lt;ritesh.list@gmail.com&gt;
Link: https://lore.kernel.org/r/20230928160407.142069-2-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: use ext4_fc_tl_mem in fast-commit replay path</title>
<updated>2023-02-09T15:43:23Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-12-17T05:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=11768cfd98136dd8399480c60b7a5d3d3c7b109b'/>
<id>urn:sha1:11768cfd98136dd8399480c60b7a5d3d3c7b109b</id>
<content type='text'>
To avoid 'sparse' warnings about missing endianness conversions, don't
store native endianness values into struct ext4_fc_tl.  Instead, use a
separate struct type, ext4_fc_tl_mem.

Fixes: dcc5827484d6 ("ext4: factor out ext4_fc_get_tl()")
Cc: Ye Bin &lt;yebin10@huawei.com&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20221217050212.150665-1-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: switch jbd2_submit_inode_data() to use fs-provided hook for data writeout</title>
<updated>2022-12-09T02:49:25Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2022-12-07T11:27:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f30ff35f6266993405c8659e48fddc3180692164'/>
<id>urn:sha1:f30ff35f6266993405c8659e48fddc3180692164</id>
<content type='text'>
jbd2_submit_inode_data() hardcoded use of
jbd2_journal_submit_inode_data_buffers() for submission of data pages.
Make it use j_submit_inode_data_buffers hook instead. This effectively
switches ext4 fastcommits to use ext4_writepages() for data writeout
instead of generic_writepages().

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20221207112722.22220-9-jack@suse.cz
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: simplify fast-commit CRC calculation</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8805dbcb3e83a4e5a6c91edc15643a7498e576ce'/>
<id>urn:sha1:8805dbcb3e83a4e5a6c91edc15643a7498e576ce</id>
<content type='text'>
Instead of checksumming each field as it is added to the block, just
checksum each block before it is written.  This is simpler, and also
much more efficient.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-8-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix off-by-one errors in fast-commit block filling</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48a6a66db82b8043d298a630f22c62d43550cae5'/>
<id>urn:sha1:48a6a66db82b8043d298a630f22c62d43550cae5</id>
<content type='text'>
Due to several different off-by-one errors, or perhaps due to a late
change in design that wasn't fully reflected in the code that was
actually merged, there are several very strange constraints on how
fast-commit blocks are filled with tlv entries:

- tlvs must start at least 10 bytes before the end of the block, even
  though the minimum tlv length is 8.  Otherwise, the replay code will
  ignore them.  (BUG: ext4_fc_reserve_space() could violate this
  requirement if called with a len of blocksize - 9 or blocksize - 8.
  Fortunately, this doesn't seem to happen currently.)

- tlvs must end at least 1 byte before the end of the block.  Otherwise
  the replay code will consider them to be invalid.  This quirk
  contributed to a bug (fixed by an earlier commit) where uninitialized
  memory was being leaked to disk in the last byte of blocks.

Also, strangely these constraints don't apply to the replay code in
e2fsprogs, which will accept any tlvs in the blocks (with no bounds
checks at all, but that is a separate issue...).

Given that this all seems to be a bug, let's fix it by just filling
blocks with tlv entries in the natural way.

Note that old kernels will be unable to replay fast-commit journals
created by kernels that have this commit.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-7-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix unaligned memory access in ext4_fc_reserve_space()</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8415ce07ecf0cc25efdd5db264a7133716e503cf'/>
<id>urn:sha1:8415ce07ecf0cc25efdd5db264a7133716e503cf</id>
<content type='text'>
As is done elsewhere in the file, build the struct ext4_fc_tl on the
stack and memcpy() it into the buffer, rather than directly writing it
to a potentially-unaligned location in the buffer.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-6-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: add missing validation of fast-commit record lengths</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64b4a25c3de81a69724e888ec2db3533b43816e2'/>
<id>urn:sha1:64b4a25c3de81a69724e888ec2db3533b43816e2</id>
<content type='text'>
Validate the inode and filename lengths in fast-commit journal records
so that a malicious fast-commit journal cannot cause a crash by having
invalid values for these.  Also validate EXT4_FC_TAG_DEL_RANGE.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-5-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix leaking uninitialized memory in fast-commit journal</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=594bc43b410316d70bb42aeff168837888d96810'/>
<id>urn:sha1:594bc43b410316d70bb42aeff168837888d96810</id>
<content type='text'>
When space at the end of fast-commit journal blocks is unused, make sure
to zero it out so that uninitialized memory is not leaked to disk.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-4-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: don't set up encryption key during jbd2 transaction</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c0d5778385cb3618ff26a561ce41de2b7d9de70'/>
<id>urn:sha1:4c0d5778385cb3618ff26a561ce41de2b7d9de70</id>
<content type='text'>
Commit a80f7fcf1867 ("ext4: fixup ext4_fc_track_* functions' signature")
extended the scope of the transaction in ext4_unlink() too far, making
it include the call to ext4_find_entry().  However, ext4_find_entry()
can deadlock when called from within a transaction because it may need
to set up the directory's encryption key.

Fix this by restoring the transaction to its original scope.

Reported-by: syzbot+1a748d0007eeac3ab079@syzkaller.appspotmail.com
Fixes: a80f7fcf1867 ("ext4: fixup ext4_fc_track_* functions' signature")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-3-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: disable fast-commit of encrypted dir operations</title>
<updated>2022-12-09T02:49:24Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2022-11-06T22:48:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0fbcb5251fc81b58969b272c4fb7374a7b922e3e'/>
<id>urn:sha1:0fbcb5251fc81b58969b272c4fb7374a7b922e3e</id>
<content type='text'>
fast-commit of create, link, and unlink operations in encrypted
directories is completely broken because the unencrypted filenames are
being written to the fast-commit journal instead of the encrypted
filenames.  These operations can't be replayed, as encryption keys
aren't present at journal replay time.  It is also an information leak.

Until if/when we can get this working properly, make encrypted directory
operations ineligible for fast-commit.

Note that fast-commit operations on encrypted regular files continue to
be allowed, as they seem to work.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: &lt;stable@vger.kernel.org&gt; # v5.10+
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Link: https://lore.kernel.org/r/20221106224841.279231-2-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
