aboutsummaryrefslogtreecommitdiff
path: root/tests/ipc-req
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-10-30 13:34:18 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2024-11-01 10:27:36 +0200
commitf139fff6ae7063c1965fa3085bb2585d7d838d72 (patch)
tree7ee9f7c6a1ee09dba93c086cd66861474b821c97 /tests/ipc-req
parentb576c1d477bf476f277d32ecf60c312e4a97490d (diff)
downloadkmi-f139fff6ae7063c1965fa3085bb2585d7d838d72.tar.gz
kmi-f139fff6ae7063c1965fa3085bb2585d7d838d72.zip
rpc actually marks and unmarks stack regions
+ Processes won't be able to read previous stack frames etc
Diffstat (limited to 'tests/ipc-req')
-rw-r--r--tests/ipc-req/init.c28
-rw-r--r--tests/ipc-req/source.mk3
2 files changed, 18 insertions, 13 deletions
diff --git a/tests/ipc-req/init.c b/tests/ipc-req/init.c
index 3439335..90e04a7 100644
--- a/tests/ipc-req/init.c
+++ b/tests/ipc-req/init.c
@@ -4,19 +4,25 @@ START(pid, tid, d0, d1, d2, d3)
{
check(pid == 0 || pid == 1, "illegal pid for init");
if (pid == 0) {
- /* send request to ourselves */
- printf("sending ipc req to ourselves\n");
- struct sys_ret r = sys_ipc_req4(1, 1, 2, 3, 4);
- printf("returned ipc req to ourselves\n");
- check(r.s == OK, "not OK return\n");
- check(r.id == 1, "not OK response ID\n");
- check(r.a0 == 1, "not OK d0 response\n");
- check(r.a1 == 2, "not OK d1 response\n");
- check(r.a2 == 3, "not OK d2 response\n");
- check(r.a3 == 4, "not OK d3 response\n");
+ printf("doing nonsense response\n");
+ enum sys_status s = sys_ipc_resp0();
+ check(s != OK, "OK return?\n");
+
+ for (size_t i = 0; i < 3; ++i) {
+ printf("sending ipc req %zd to ourselves\n", i);
+ struct sys_ret r = sys_ipc_req4(1, 1, 2, 3, 4);
+
+ printf("returned ipc req to ourselves\n");
+ check(r.s == OK, "not OK return\n");
+ check(r.id == 1, "not OK response ID\n");
+ check(r.a0 == 1, "not OK d0 response\n");
+ check(r.a1 == 2, "not OK d1 response\n");
+ check(r.a2 == 3, "not OK d2 response\n");
+ check(r.a3 == 4, "not OK d3 response\n");
+ }
/* try to request to non-existing proc */
- r = sys_ipc_req0(200);
+ struct sys_ret r = sys_ipc_req0(200);
check(r.s != OK, "got OK return for illegal pid\n");
}
else if (pid == 1) {
diff --git a/tests/ipc-req/source.mk b/tests/ipc-req/source.mk
index 0e65407..4b77d99 100644
--- a/tests/ipc-req/source.mk
+++ b/tests/ipc-req/source.mk
@@ -1,2 +1 @@
-DO != ./scripts/gen-prog -n ipc-req -p init init.c
-DO != ./scripts/gen-simple -n ipc-req -p init
+TESTS += ipc-req