public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] lib: allow checkpoints to be used by any uid
@ 2017-10-04 10:42 Jan Stancek
  2017-10-04 10:42 ` [LTP] [PATCH 2/2] security/dirtyc0w: synchronize parent and child Jan Stancek
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Stancek @ 2017-10-04 10:42 UTC (permalink / raw)
  To: ltp

Allow unprivileged child to synchronize with privileged parent.
Use chmod after open, because effective permissions set by open()
are modified by the process's umask: (mode & ~umask).

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 lib/tst_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 26414e31ca77..233b370794a6 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -93,6 +93,7 @@ static void setup_ipc(void)
 	ipc_fd = open(shm_path, O_CREAT | O_EXCL | O_RDWR, 0600);
 	if (ipc_fd < 0)
 		tst_brk(TBROK | TERRNO, "open(%s)", shm_path);
+	SAFE_CHMOD(shm_path, 0666);
 
 	SAFE_FTRUNCATE(ipc_fd, size);
 
-- 
1.8.3.1


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

end of thread, other threads:[~2017-10-06 11:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 10:42 [LTP] [PATCH 1/2] lib: allow checkpoints to be used by any uid Jan Stancek
2017-10-04 10:42 ` [LTP] [PATCH 2/2] security/dirtyc0w: synchronize parent and child Jan Stancek
2017-10-04 12:02   ` Cyril Hrubis
2017-10-04 12:25     ` Jan Stancek
2017-10-06 11:37       ` Cyril Hrubis
2017-10-06 11:57         ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox