From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Shaoying Xu <shaoyi@amazon.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.4 1/2] ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path
Date: Sat, 25 Jan 2025 09:03:44 -0500 [thread overview]
Message-ID: <20250124204716-83bc43904f7cce15@stable.kernel.org> (raw)
In-Reply-To: <20250125003135.11978-2-shaoyi@amazon.com>
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 73c384c0cdaa8ea9ca9ef2d0cff6a25930f1648e
WARNING: Author mismatch between patch and upstream commit:
Backport author: Shaoying Xu<shaoyi@amazon.com>
Commit author: Theodore Ts'o<tytso@mit.edu>
Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Present (exact SHA1)
5.10.y | Present (exact SHA1)
5.4.y | Not found
Note: The patch differs from the upstream commit:
---
1: 73c384c0cdaa8 ! 1: ad990516172ca ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path
@@ Metadata
## Commit message ##
ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path
+ [ Upstream commit 73c384c0cdaa8ea9ca9ef2d0cff6a25930f1648e ]
+
We can't fail in the truncate path without requiring an fsck.
Add work around for this by using a combination of retry loops
and the __GFP_NOFAIL flag.
@@ Commit message
Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20200507175028.15061-1-pendleton@google.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+ Stable-dep-of: c26ab35702f8 ("ext4: fix slab-use-after-free in ext4_split_extent_at()")
+ [v5.4: resolved contextual conflict in __read_extent_tree_block]
+ Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
## fs/ext4/ext4.h ##
@@ fs/ext4/ext4.h: enum {
@@ fs/ext4/extents.c: ext4_force_split_extent_at(handle_t *handle, struct inode *in
+ flags);
}
- static int
+ /*
@@ fs/ext4/extents.c: __read_extent_tree_block(const char *function, unsigned int line,
- {
struct buffer_head *bh;
int err;
-+ gfp_t gfp_flags = __GFP_MOVABLE | GFP_NOFS;
+ ext4_fsblk_t pblk;
++ gfp_t gfp_flags = __GFP_MOVABLE | GFP_NOFS;
+
+ if (flags & EXT4_EX_NOFAIL)
-+ gfp_flags |= __GFP_NOFAIL;
++ gfp_flags |= __GFP_NOFAIL;
+ pblk = ext4_idx_pblock(idx);
- bh = sb_getblk_gfp(inode->i_sb, pblk, __GFP_MOVABLE | GFP_NOFS);
+ bh = sb_getblk_gfp(inode->i_sb, pblk, gfp_flags);
if (unlikely(!bh))
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.4.y | Success | Success |
next prev parent reply other threads:[~2025-01-25 14:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 0:31 [PATCH 5.4 0/2] CVE-2024-49884 Shaoying Xu
2025-01-25 0:31 ` [PATCH 5.4 1/2] ext4: avoid ext4_error()'s caused by ENOMEM in the truncate path Shaoying Xu
2025-01-25 14:03 ` Sasha Levin [this message]
2025-01-25 0:31 ` [PATCH 5.4 2/2] ext4: fix slab-use-after-free in ext4_split_extent_at() Shaoying Xu
2025-01-25 14:03 ` Sasha Levin
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=20250124204716-83bc43904f7cce15@stable.kernel.org \
--to=sashal@kernel.org \
--cc=shaoyi@amazon.com \
--cc=stable@vger.kernel.org \
/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.