Skip to content

Infrastructure to allow fixing exec deadlocks

Eric W. Biederman linux-api linux-doc linux-fsdevel linux-mm linux-security-module lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2exec: Properly mark the point of no returnfs/exec.c include/linux/binfmts.h+10 -46 replies
2/2exec: Add a exec_update_mutex to replace cred_guard_mutexfs/exec.c include/linux/sched/signal.h kernel/fork.c+13 -110 replies

Reviews trailers per patch

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

PatchBernd EdlingerChristian BraunerKees CookKirill Tkhai
SeriesR-b R-b R-b R-b R-b R-b A-b A-b A-b A-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] Infrastructure to allow fixing exec deadlocks

Bernd, everyone

This is how I think the infrastructure change should look that makes way for fixing this issue.

- Correct the point of no return.
- Add a new mutex to replace cred_guard_mutex

Then I think it is just going through the existing users of cred_guard_mutex and fixing them to use the new one.

There really aren't that many users of cred_guard_mutex so we should be able to get through the easy ones fairly quickly. And anything that isn't easy we can wait until we have a good fix.

The users of cred_guard_mutex that I saw were:

    fs/proc/base.c:
       proc_pid_attr_write
       do_io_accounting
       proc_pid_stack
       proc_pid_syscall
       proc_pid_personality
    
    perf_event_open
    mm_access
    kcmp
    pidfd_fget
    seccomp_set_mode_filter

Bernd does this make sense to you?

I think we can fix the seccomp/no_new_privs issue with some careful refactoring. We can probably do the same for ptrace but that appears to need a little lsm bug fixing.

My goal here is to allow us to fix the uncontroversial easy bits. While still allowing the difficult tricky bits to be fixed.

Eric W. Biederman (2):
exec: Properly mark the point of no return
exec: Add a exec_update_mutex to replace cred_guard_mutex

 fs/exec.c                    | 11 ++++++++---
 include/linux/binfmts.h      |  7 ++++++-
 include/linux/sched/signal.h |  9 ++++++++-
 kernel/fork.c                |  1 +
 4 files changed, 23 insertions(+), 5 deletions(-)

Eric