Skip to content

exec: Transform exec_update_mutex into a rw_semaphore

Eric W. Biederman lkml 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 33 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3rwsem: Implement down_read_killable_nestedinclude/linux/rwsem.h kernel/locking/rwsem.c+16 -01 reply
2/3rwsem: Implement down_read_interruptibleinclude/linux/rwsem.h kernel/locking/rwsem.c+27 -016 replies
3/3exec: Transform exec_update_mutex into a rw_semaphorefs/exec.c fs/proc/base.c include/linux/sched/signal.h +5 more+44 -4317 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWaiman LongDavidlohr Bueso
SeriesA-b
1/3A-b
2/3A-b
3/3

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

Read the v1 thread

Cover letter [PATCH 0/3] exec: Transform exec_update_mutex into a rw_semaphore

Recently syzbot reported[0] that there is a deadlock amongst the users of exec_update_mutex.

The simplest and most robust solution appears to be making exec_update_mutex a read/write lock and having everything execept for exec take the lock for read.

This set of changes upgrades rwsem so it has the functionality needed and uses a rw_semaphore to replace the current mutex.

Eric W. Biederman (3):
rwsem: Implement down_read_killable_nested
rwsem: Implement down_read_interruptible
exec: Transform exec_update_mutex into a rw_semaphore

 fs/exec.c                    | 12 ++++++------
 fs/proc/base.c               | 10 +++++-----
 include/linux/rwsem.h        |  3 +++
 include/linux/sched/signal.h | 11 ++++++-----
 init/init_task.c             |  2 +-
 kernel/events/core.c         | 12 ++++++------
 kernel/fork.c                |  6 +++---
 kernel/kcmp.c                | 30 +++++++++++++++---------------
 kernel/locking/rwsem.c       | 40 ++++++++++++++++++++++++++++++++++++++++
 kernel/pid.c                 |  4 ++--
 10 files changed, 87 insertions(+), 43 deletions(-)

[0] https://lkml.kernel.org/r/[email protected]

Eric