[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 339b84ab6b1d66900c27bd999271cb2ae40ce812
WARNING: Author mismatch between patch and upstream commit: Backport author: Bin Lan bin.lan.cn@windriver.com Commit author: Kent Overstreet kent.overstreet@linux.dev
Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.11.y | Present (exact SHA1) 6.6.y | Not found 6.1.y | Not found
Note: The patch differs from the upstream commit: --- --- - 2024-11-21 06:59:47.405492326 -0500 +++ /tmp/tmp.e7rRZ1qHWZ 2024-11-21 06:59:47.399091975 -0500 @@ -1,3 +1,5 @@ +[ Upstream commit 339b84ab6b1d66900c27bd999271cb2ae40ce812 ] + If a BUG_ON() can be hit in the wild, it shouldn't be a BUG_ON()
For reference, this has popped up once in the CI, and we'll need more @@ -51,15 +53,17 @@ 03246 ========= FAILED TIMEOUT copygc_torture_no_checksum in 7200s
Signed-off-by: Kent Overstreet kent.overstreet@linux.dev +[ Resolve minor conflicts to fix CVE-2024-42252 ] +Signed-off-by: Bin Lan bin.lan.cn@windriver.com --- - lib/closure.c | 10 ++++++++-- + drivers/md/bcache/closure.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
-diff --git a/lib/closure.c b/lib/closure.c -index 07409e9e35a53..2e1ee9fdec081 100644 ---- a/lib/closure.c -+++ b/lib/closure.c -@@ -17,12 +17,18 @@ static inline void closure_put_after_sub(struct closure *cl, int flags) +diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c +index d8d9394a6beb..18f21d4e9aaa 100644 +--- a/drivers/md/bcache/closure.c ++++ b/drivers/md/bcache/closure.c +@@ -17,10 +17,16 @@ static inline void closure_put_after_sub(struct closure *cl, int flags) { int r = flags & CLOSURE_REMAINING_MASK;
@@ -71,12 +75,13 @@ + r &= ~CLOSURE_GUARD_MASK;
if (!r) { - smp_acquire__after_ctrl_dep(); - + WARN(flags & ~CLOSURE_DESTRUCTOR, + "closure ref hit 0 with incorrect flags set: %x (%u)", + flags & ~CLOSURE_DESTRUCTOR, (unsigned) __fls(flags)); + - cl->closure_get_happened = false; - if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) { + atomic_set(&cl->remaining, + CLOSURE_REMAINING_INITIALIZER); +-- +2.43.0 + ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |