Skip to content

backport to fix a race condition/UAF in padata_reorder

Bin Lan linux-crypto lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2padata: Fix pd UAF once and for allinclude/linux/padata.h kernel/padata.c+37 -1020 replies
2/2padata: Remove comment for reorder_workinclude/linux/padata.h+0 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 6.1.y 0/2] backport to fix a race condition/UAF in padata_reorder

From: Bin Lan <[email protected]>

This series backports the fix for a use-after-free vulnerability in the padata subsystem, to the Linux 6.1.y stable branch.

Backport notes for 6.1.y:

- The upstream fix (commit 71203f68c774) was written against mainline which uses the 2-argument cpumask_next_wrap(cpu, mask) API introduced by dc5bb9b769c9 ("cpumask: deprecate cpumask_next_wrap()"). Since 6.1.y still has the original 4-argument API, the call in padata_reorder() is adapted to:
cpumask_next_wrap(cpu, pd->cpumask.pcpu, -1, false)
This is functionally equivalent.

- The context in padata_find_next() differs from mainline due to f954a2d37637 ("padata: switch padata_find_next() to using cpumask_next_wrap()") not being present in 6.1.y. The conflict was resolved.

After applying this series, kernel/padata.c matches the upstream file at commit 71203f68c774 with a few differences. None of these differences affect the fix, the core changes to padata_find_next(), padata_reorder(), and padata_do_serial() are identical.

Thanks
Bin Lan

Herbert Xu (2):
padata: Fix pd UAF once and for all
padata: Remove comment for reorder_work

 include/linux/padata.h |   4 --
 kernel/padata.c        | 136 +++++++++++------------------------------
 2 files changed, 37 insertions(+), 103 deletions(-)
Signature · 1 line
2.43.0