Repository navigation
Commit f70102c
proc: Track /proc/$pid/attr/ opener mm_struct
commit 591a22c upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 951358a commit f70102c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2675 | 2675 | | |
2676 | 2676 | | |
2677 | 2677 | | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
2678 | 2683 | | |
2679 | 2684 | | |
2680 | 2685 | | |
| |||
2705 | 2710 | | |
2706 | 2711 | | |
2707 | 2712 | | |
2708 | | - | |
| 2713 | + | |
2709 | 2714 | | |
2710 | 2715 | | |
2711 | 2716 | | |
| |||
2755 | 2760 | | |
2756 | 2761 | | |
2757 | 2762 | | |
| 2763 | + | |
2758 | 2764 | | |
2759 | 2765 | | |
2760 | 2766 | | |
| 2767 | + | |
2761 | 2768 | | |
2762 | 2769 | | |
2763 | 2770 | | |
| |||
0 commit comments