lkml.org 
[lkml]   [2020]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subject[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/00000000000063640c05ade8e3de@google.com

Eric

\
 
 \ /
  Last update: 2020-12-03 21:13    [W:0.133 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site