linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/coredump: open coredump file in O_WRONLY instead of O_RDWR
@ 2023-04-20 12:04 Vladimir Sementsov-Ogievskiy
  2023-05-10 15:15 ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2023-04-20 12:04 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner; +Cc: vsementsov, linux-fsdevel, linux-kernel

This makes it possible to make stricter apparmor profile and don't
allow the program to read any coredump in the system.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 fs/coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/coredump.c b/fs/coredump.c
index 5df1e6e1eb2b..8f263a389175 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -646,7 +646,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
 	} else {
 		struct mnt_idmap *idmap;
 		struct inode *inode;
-		int open_flags = O_CREAT | O_RDWR | O_NOFOLLOW |
+		int open_flags = O_CREAT | O_WRONLY | O_NOFOLLOW |
 				 O_LARGEFILE | O_EXCL;
 
 		if (cprm.limit < binfmt->min_coredump)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-16 13:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20 12:04 [PATCH] fs/coredump: open coredump file in O_WRONLY instead of O_RDWR Vladimir Sementsov-Ogievskiy
2023-05-10 15:15 ` Vladimir Sementsov-Ogievskiy
2023-05-15 17:55   ` Christian Brauner
2023-05-15 18:50     ` Linus Torvalds
2023-05-15 19:13       ` Linus Torvalds
2023-05-16  8:05         ` Vladimir Sementsov-Ogievskiy
2023-05-16 13:46         ` Christian Brauner
2023-05-16 13:47           ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).