Repository navigation
Commit 591a22c
proc: Track /proc/$pid/attr/ opener mm_struct
Commit bfb819e ("proc: Check /proc/$pid/attr/ writes against file opener")
tried to make sure that there could not be a confusion between the opener of
a /proc/$pid/attr/ file and the writer. It used struct cred to make sure
the privileges didn't change. However, there were existing cases where a more
privileged thread was passing the opened fd to a differently privileged thread
(during container setup). Instead, use mm_struct to track whether the opener
and writer are still the same process. (This is what several other proc files
already do, though for different reasons.)
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Andrea Righi <andrea.righi@canonical.com>
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Fixes: bfb819e ("proc: Check /proc/$pid/attr/ writes against file opener")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 4c8684f commit 591a22c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2674 | 2674 | | |
2675 | 2675 | | |
2676 | 2676 | | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
2677 | 2682 | | |
2678 | 2683 | | |
2679 | 2684 | | |
| |||
2704 | 2709 | | |
2705 | 2710 | | |
2706 | 2711 | | |
2707 | | - | |
| 2712 | + | |
2708 | 2713 | | |
2709 | 2714 | | |
2710 | 2715 | | |
| |||
2754 | 2759 | | |
2755 | 2760 | | |
2756 | 2761 | | |
| 2762 | + | |
2757 | 2763 | | |
2758 | 2764 | | |
2759 | 2765 | | |
| 2766 | + | |
2760 | 2767 | | |
2761 | 2768 | | |
2762 | 2769 | | |
| |||
0 commit comments