syscalls/shmctl05: new test for IPC file use-after-free bug
PATCH v3 1/1 syscalls/shmctl05: new test for IPC file use-after-free bug
From: Eric Biggers <[email protected]>
Test for a bug in the System V IPC subsystem that resulted in a shared memory file being used after it was freed (or being freed).
---
Changed since v2:
- Add tst_timer_check(CLOCK_MONOTONIC).
- Use 'CFLAGS += -pthread' instead of 'LDLIBS += -lpthread'.
- Add 'LDLIBS += -lrt' (for timer functions).
Changed since v1:
- Use "fuzzy sync" spinlocks instead of random sleeps.
- Use threads with .timeout instead of processes.
- Use SAFE_SHMAT() instead of shmat() directly.
- Use tst_timer_expired_ms() instead of tst_timer_stop() + tst_timer_elapsed_ms().
runtest/syscalls | 1 + runtest/syscalls-ipc | 1 + .../kernel/syscalls/ipc/shmctl/.gitignore | 1 + testcases/kernel/syscalls/ipc/shmctl/Makefile | 3 + .../kernel/syscalls/ipc/shmctl/shmctl05.c | 114 ++++++++++++++++++ 5 files changed, 120 insertions(+) create mode 100644 testcases/kernel/syscalls/ipc/shmctl/shmctl05.c
runtest/syscalls +1 -0
@@ -1187,6 +1187,7 @@ shmctl01 shmctl01 shmctl02 shmctl02 shmctl03 shmctl03 shmctl04 shmctl04 +shmctl05 shmctl05 shmdt01 shmdt01 shmdt02 shmdt02
runtest/syscalls-ipc +1 -0
@@ -53,6 +53,7 @@ shmctl01 shmctl01 shmctl02 shmctl02 shmctl03 shmctl03 shmctl04 shmctl04 +shmctl05 shmctl05 shmdt01 shmdt01 shmdt02 shmdt02
testcases/kernel/syscalls/ipc/shmctl/.gitignore +1 -0
@@ -2,3 +2,4 @@ /shmctl02 /shmctl03 /shmctl04 +/shmctl05
testcases/kernel/syscalls/ipc/shmctl/Makefile +3 -0
@@ -18,6 +18,9 @@ top_srcdir ?= ../../../../.. +shmctl05: CFLAGS += -pthread +shmctl05: LDLIBS += -lrt + include $(top_srcdir)/include/mk/testcases.mk include $(abs_srcdir)/../Makefile.inc include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/ipc/shmctl/shmctl05.c new file +114 -0
114 lines not on this page · raw message
Signature · 1 line
2.18.0.203.gfac676dfb9-goog
PATCH v3 1/1 syscalls/shmctl05: new test for IPC file use-after-free bug
----- Original Message -----
Quoted 6 lines
From: Eric Biggers <[email protected]>
Test for a bug in the System V IPC subsystem that resulted in a shared memory file being used after it was freed (or being freed).
Signed-off-by Eric Biggers <[email protected]>
ack, I'll give Cyril chance to review as well.
Regards,
Jan
PATCH v3 1/1 syscalls/shmctl05: new test for IPC file use-after-free bug
In reply to Eric BiggersHi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]