Skip to content

sched: Fix dup_user_cpus_ptr() & do_set_cpus_allowed() bugs

Waiman Long lkml oe-lkp stable 4 versions – Applied

Status from this message: The following commit has been merged into the sched/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 1 replyApplied
  2. v52 patches 0 repliesSuperseded
  3. v42 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v21 patch2 repliesSuperseded

Changes in v6 from the cover letter

- Update patch 2 to fix build error with !CONFIG_SMP configs.

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/2sched: Fix use-after-free bug in dup_user_cpus_ptr()kernel/sched/core.c+29 -51 reply
2/2sched: Use kfree_rcu() in do_set_cpus_allowed()kernel/sched/core.c+29 -40 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchWill Deacon
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/2] sched: Fix dup_user_cpus_ptr() & do_set_cpus_allowed() bugs

v6:
- Update patch 2 to fix build error with !CONFIG_SMP configs.

v5:
- Add an alloc_user_cpus_ptr() helper and use it in patch 2.

v4:
- Make sure user_cpus_ptr allocation size is large enough for rcu_head.

This series fixes a UAF bug in dup_user_cpus_ptr() and uses kfree_rcu() in do_set_cpus_allowed to avoid lockdep splats.

Waiman Long (2):
sched: Fix use-after-free bug in dup_user_cpus_ptr()
sched: Use kfree_rcu() in do_set_cpus_allowed()

 kernel/sched/core.c | 65 +++++++++++++++++++++++++++++++++++++++------
 1 file changed, 57 insertions(+), 8 deletions(-)
Signature · 1 line
2.31.1