Browse Source

[LibOS/tests/ltp] Add getrlimit{01,02} to passing LTP tests

Also add missing EFAULT error handling in getrlimit().
Isaku Yamahata 5 years ago
parent
commit
5aa1483079

+ 2 - 0
LibOS/shim/src/sys/shim_getrlimit.c

@@ -72,6 +72,8 @@ int shim_do_getrlimit (int resource, struct __kernel_rlimit * rlim)
 {
     if (resource < 0 || RLIM_NLIMITS <= resource)
         return -EINVAL;
+    if (!rlim || test_user_memory(rlim, sizeof(*rlim), true))
+        return -EFAULT;
 
     switch (resource) {
         case RLIMIT_STACK:

+ 0 - 1
LibOS/shim/test/apps/ltp/BLOCKED

@@ -66,7 +66,6 @@ fork14
 getitimer02
 getresgid02
 getresgid03
-getrlimit02
 getrusage02
 gettimeofday01
 gettimeofday02

+ 17 - 0
LibOS/shim/test/apps/ltp/PASSED

@@ -288,11 +288,24 @@ getpgrp01,1
 getpid01,1
 getpid02,1
 getppid01,1
+getrlimit01,1
+getrlimit01,2
 getrlimit01,3
 getrlimit01,4
+getrlimit01,5
 getrlimit01,6
+getrlimit01,7
 getrlimit01,8
+getrlimit01,9
 getrlimit01,10
+getrlimit01,11
+getrlimit01,12
+getrlimit01,13
+getrlimit01,14
+getrlimit01,15
+getrlimit01,16
+getrlimit02,1
+getrlimit02,2
 getsid01,1
 getsockname01,3
 getsockname01,4
@@ -827,6 +840,10 @@ setpgid01,2
 setpgrp01,1
 setpgrp02,1
 setrlimit01,1
+setrlimit01,3
+setrlimit01,4
+setrlimit02,1
+setrlimit02,2
 setsockopt01,1
 setsockopt01,2
 setsockopt01,3