script_core 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (381) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +8 -6
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -1
  6. data/bin/sandbox +1 -1
  7. data/ext/enterprise_script_service/Rakefile +1 -1
  8. data/ext/enterprise_script_service/flags.rb +5 -0
  9. data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
  10. data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
  11. data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
  12. data/ext/enterprise_script_service/libseccomp/README.md +1 -1
  13. data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
  14. data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
  15. data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
  16. data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
  17. data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
  18. data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
  19. data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
  20. data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
  21. data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
  22. data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
  23. data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
  24. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
  25. data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
  26. data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
  27. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
  28. data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
  29. data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
  30. data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
  31. data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
  32. data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
  33. data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
  34. data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
  35. data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
  36. data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
  37. data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
  38. data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
  39. data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
  40. data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
  41. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
  42. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
  43. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
  44. data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
  45. data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
  46. data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
  47. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
  48. data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
  49. data/ext/enterprise_script_service/mruby/.gitignore +2 -2
  50. data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
  51. data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
  52. data/ext/enterprise_script_service/mruby/README.md +21 -8
  53. data/ext/enterprise_script_service/mruby/Rakefile +4 -13
  54. data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
  55. data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
  56. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
  57. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
  58. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
  59. data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
  60. data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
  61. data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
  62. data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
  63. data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
  64. data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
  65. data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
  66. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
  67. data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
  68. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
  69. data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
  70. data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
  71. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
  72. data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
  73. data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
  74. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
  75. data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
  76. data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
  77. data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
  78. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
  79. data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
  80. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
  81. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
  82. data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
  83. data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
  84. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
  85. data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
  86. data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
  87. data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
  88. data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
  89. data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
  90. data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
  91. data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
  92. data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
  93. data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
  94. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
  95. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
  96. data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
  97. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
  98. data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
  99. data/ext/enterprise_script_service/mruby/minirake +27 -11
  100. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
  101. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
  102. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
  103. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
  104. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
  105. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
  106. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
  107. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
  108. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
  109. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
  110. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
  111. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
  112. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
  113. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
  114. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
  115. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
  116. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
  117. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
  118. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
  119. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
  120. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
  121. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
  122. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
  123. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
  124. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
  125. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
  126. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
  127. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
  128. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
  129. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
  130. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
  131. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
  132. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
  133. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
  134. data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
  135. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
  136. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
  137. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
  138. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
  139. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
  140. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
  141. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
  142. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
  143. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
  144. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
  145. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
  146. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
  147. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
  148. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
  149. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
  150. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
  151. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
  152. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
  153. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
  154. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
  155. data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
  156. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
  157. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
  158. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
  159. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
  160. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
  161. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
  162. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
  163. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
  164. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
  165. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
  166. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
  167. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
  168. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
  169. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
  170. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
  171. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
  172. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
  173. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
  174. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
  175. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
  176. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
  177. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
  178. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
  179. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
  180. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
  181. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
  182. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
  183. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
  184. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
  185. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
  186. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
  187. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
  188. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
  189. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
  190. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
  191. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
  192. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
  193. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
  194. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
  195. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
  196. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
  197. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
  198. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
  199. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
  200. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
  201. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
  202. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
  203. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
  204. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
  205. data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
  206. data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
  207. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
  208. data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
  209. data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
  210. data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
  211. data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
  212. data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
  213. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
  214. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
  215. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
  216. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
  217. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
  218. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
  219. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
  220. data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
  221. data/ext/enterprise_script_service/mruby/src/array.c +95 -46
  222. data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
  223. data/ext/enterprise_script_service/mruby/src/class.c +370 -278
  224. data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
  225. data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
  226. data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
  227. data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
  228. data/ext/enterprise_script_service/mruby/src/error.c +157 -55
  229. data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
  230. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
  231. data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
  232. data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
  233. data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
  234. data/ext/enterprise_script_service/mruby/src/load.c +40 -76
  235. data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
  236. data/ext/enterprise_script_service/mruby/src/object.c +16 -39
  237. data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
  238. data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
  239. data/ext/enterprise_script_service/mruby/src/range.c +22 -35
  240. data/ext/enterprise_script_service/mruby/src/state.c +5 -94
  241. data/ext/enterprise_script_service/mruby/src/string.c +874 -710
  242. data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
  243. data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
  244. data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
  245. data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
  246. data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
  247. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
  248. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
  249. data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
  250. data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
  251. data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
  252. data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
  253. data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
  254. data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
  255. data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
  256. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
  257. data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
  258. data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
  259. data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
  260. data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
  261. data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
  262. data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
  263. data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
  264. data/ext/enterprise_script_service/mruby_config.rb +10 -0
  265. data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
  266. data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
  267. data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
  268. data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
  269. data/ext/enterprise_script_service/msgpack/README.md +1 -1
  270. data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
  271. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
  272. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
  273. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
  274. data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
  275. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
  276. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
  277. data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
  278. data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
  279. data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
  280. data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
  281. data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
  282. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
  283. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
  284. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
  285. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
  286. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
  287. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
  288. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
  289. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
  290. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
  291. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
  292. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
  293. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
  294. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
  295. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
  296. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
  297. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
  298. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
  299. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
  300. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
  301. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
  302. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
  303. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
  304. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
  305. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
  306. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
  307. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
  308. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
  309. data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
  310. data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
  311. data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
  312. data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
  313. data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
  314. data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
  315. data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
  316. data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
  317. data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
  318. data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
  319. data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
  320. data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
  321. data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
  322. data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
  323. data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
  324. data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
  325. data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
  326. data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
  327. data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
  328. data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
  329. data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
  330. data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
  331. data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
  332. data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
  333. data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
  334. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
  335. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
  336. data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
  337. data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
  338. data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
  339. data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
  340. data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
  341. data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
  342. data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
  343. data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
  344. data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
  345. data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
  346. data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
  347. data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
  348. data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
  349. data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
  350. data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
  351. data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
  352. data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
  353. data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
  354. data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
  355. data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
  356. data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
  357. data/lib/script_core/version.rb +1 -1
  358. data/lib/tasks/mruby/engine.gembox.example +1 -0
  359. data/lib/tasks/script_core.rake +21 -3
  360. data/spec/dummy/app/helpers/fields_helper.rb +2 -2
  361. data/spec/dummy/mruby/engine.gembox +1 -0
  362. data/spec/script_core_spec.rb +1 -1
  363. metadata +38 -22
  364. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
  365. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
  366. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
  367. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
  368. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
  369. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
  370. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
  371. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
  372. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
  373. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
  374. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
  375. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
  376. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
  377. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
  378. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
  379. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
  380. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
  381. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -27,16 +27,16 @@ const struct arch_def arch_def_s390 = {
27
27
  };
28
28
 
29
29
  /**
30
- * Convert a multiplexed pseudo socket syscall into a direct syscall
31
- * @param socketcall the multiplexed pseudo syscall number
30
+ * Convert a multiplexed pseudo syscall into a direct syscall
31
+ * @param syscall the multiplexed pseudo syscall number
32
32
  *
33
33
  * Return the related direct syscall number, __NR_SCMP_UNDEF is there is
34
34
  * no related syscall, or __NR_SCMP_ERROR otherwise.
35
35
  *
36
36
  */
37
- static int _s390_sock_demux(int socketcall)
37
+ static int _s390_syscall_demux(int syscall)
38
38
  {
39
- switch (socketcall) {
39
+ switch (syscall) {
40
40
  case -101:
41
41
  /* socket */
42
42
  return 359;
@@ -97,6 +97,43 @@ static int _s390_sock_demux(int socketcall)
97
97
  case -120:
98
98
  /* sendmmsg */
99
99
  return 345;
100
+ case -201:
101
+ /* semop - not defined */
102
+ return __NR_SCMP_UNDEF;
103
+ case -202:
104
+ /* semget */
105
+ return 393;
106
+ case -203:
107
+ /* semctl */
108
+ return 394;
109
+ case -204:
110
+ /* semtimedop - not defined */
111
+ return __NR_SCMP_UNDEF;
112
+ case -211:
113
+ /* msgsnd */
114
+ return 400;
115
+ case -212:
116
+ /* msgrcv */
117
+ return 401;
118
+ case -213:
119
+ /* msgget */
120
+ return 399;
121
+ case -214:
122
+ /* msgctl */
123
+ return 402;
124
+ case -221:
125
+ /* shmat */
126
+ return 397;
127
+ case -222:
128
+ /* shmdt */
129
+ return 398;
130
+ case -223:
131
+ /* shmget */
132
+ return 395;
133
+ case -224:
134
+ /* shmctl */
135
+ return 396;
136
+
100
137
  }
101
138
 
102
139
  return __NR_SCMP_ERROR;
@@ -110,7 +147,7 @@ static int _s390_sock_demux(int socketcall)
110
147
  * there is no related pseudo syscall, or __NR_SCMP_ERROR otherwise.
111
148
  *
112
149
  */
113
- static int _s390_sock_mux(int syscall)
150
+ static int _s390_syscall_mux(int syscall)
114
151
  {
115
152
  switch (syscall) {
116
153
  case 337:
@@ -164,6 +201,36 @@ static int _s390_sock_mux(int syscall)
164
201
  case 373:
165
202
  /* shutdown */
166
203
  return -113;
204
+ case 393:
205
+ /* semget */
206
+ return -202;
207
+ case 394:
208
+ /* semctl */
209
+ return -203;
210
+ case 400:
211
+ /* msgsnd */
212
+ return -211;
213
+ case 401:
214
+ /* msgrcv */
215
+ return -212;
216
+ case 399:
217
+ /* msgget */
218
+ return -213;
219
+ case 402:
220
+ /* msgctl */
221
+ return -214;
222
+ case 397:
223
+ /* shmat */
224
+ return -221;
225
+ case 398:
226
+ /* shmdt */
227
+ return -222;
228
+ case 395:
229
+ /* shmget */
230
+ return -223;
231
+ case 396:
232
+ /* shmctl */
233
+ return -224;
167
234
  }
168
235
 
169
236
  return __NR_SCMP_ERROR;
@@ -228,7 +295,7 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
228
295
 
229
296
  /* determine both the muxed and direct syscall numbers */
230
297
  if (sys > 0) {
231
- sys_a = _s390_sock_mux(sys);
298
+ sys_a = _s390_syscall_mux(sys);
232
299
  if (sys_a == __NR_SCMP_ERROR) {
233
300
  rc = __NR_SCMP_ERROR;
234
301
  goto add_return;
@@ -236,7 +303,7 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
236
303
  sys_b = sys;
237
304
  } else {
238
305
  sys_a = sys;
239
- sys_b = _s390_sock_demux(sys);
306
+ sys_b = _s390_syscall_demux(sys);
240
307
  if (sys_b == __NR_SCMP_ERROR) {
241
308
  rc = __NR_SCMP_ERROR;
242
309
  goto add_return;
@@ -291,24 +358,81 @@ int s390_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
291
358
  if (rc < 0)
292
359
  goto add_return;
293
360
  }
294
- } else if (sys <= -200 && sys >= -224) {
295
- /* multiplexed ipc syscalls */
361
+ } else if ((sys <= -200 && sys >= -224) || (sys >= 393 && sys <= 402)) {
362
+ /* (-200 to -224) : multiplexed ipc syscalls
363
+ (393 to 402) : direct ipc syscalls */
364
+
365
+ /* strict check for the multiplexed socket syscalls */
296
366
  for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
297
367
  if ((rule->args[iter].valid != 0) && (rule->strict)) {
298
368
  rc = -EINVAL;
299
369
  goto add_return;
300
370
  }
301
371
  }
302
- rule->args[0].arg = 0;
303
- rule->args[0].op = SCMP_CMP_EQ;
304
- rule->args[0].mask = DATUM_MAX;
305
- rule->args[0].datum = abs(sys) % 200;
306
- rule->args[0].valid = 1;
307
- rule->syscall = __s390_NR_ipc;
308
372
 
309
- rc = db_rule_add(db, rule);
310
- if (rc < 0)
311
- goto add_return;
373
+ /* determine both the muxed and direct syscall numbers */
374
+ if (sys > 0) {
375
+ sys_a = _s390_syscall_mux(sys);
376
+ if (sys_a == __NR_SCMP_ERROR) {
377
+ rc = __NR_SCMP_ERROR;
378
+ goto add_return;
379
+ }
380
+ sys_b = sys;
381
+ } else {
382
+ sys_a = sys;
383
+ sys_b = _s390_syscall_demux(sys);
384
+ if (sys_b == __NR_SCMP_ERROR) {
385
+ rc = __NR_SCMP_ERROR;
386
+ goto add_return;
387
+ }
388
+ }
389
+
390
+ /* use rule_a for the multiplexed syscall and use rule_b for
391
+ * the direct wired syscall */
392
+
393
+ if (sys_a == __NR_SCMP_UNDEF) {
394
+ rule_a = NULL;
395
+ rule_b = rule;
396
+ } else if (sys_b == __NR_SCMP_UNDEF) {
397
+ rule_a = rule;
398
+ rule_b = NULL;
399
+ } else {
400
+ /* need two rules, dup the first and link together */
401
+ rule_a = rule;
402
+ rule_dup = db_rule_dup(rule_a);
403
+ rule_b = rule_dup;
404
+ if (rule_b == NULL)
405
+ goto add_return;
406
+ rule_b->prev = rule_a;
407
+ rule_b->next = NULL;
408
+ rule_a->next = rule_b;
409
+ }
410
+
411
+ /* multiplexed socket syscalls */
412
+ if (rule_a != NULL) {
413
+ rule_a->syscall = __s390_NR_ipc;
414
+ rule_a->args[0].arg = 0;
415
+ rule_a->args[0].op = SCMP_CMP_EQ;
416
+ rule_a->args[0].mask = DATUM_MAX;
417
+ rule_a->args[0].datum = (-sys_a) % 200;
418
+ rule_a->args[0].valid = 1;
419
+ }
420
+
421
+ /* direct wired socket syscalls */
422
+ if (rule_b != NULL)
423
+ rule_b->syscall = sys_b;
424
+
425
+ /* we should be protected by a transaction checkpoint */
426
+ if (rule_a != NULL) {
427
+ rc = db_rule_add(db, rule_a);
428
+ if (rc < 0)
429
+ goto add_return;
430
+ }
431
+ if (rule_b != NULL) {
432
+ rc = db_rule_add(db, rule_b);
433
+ if (rc < 0)
434
+ goto add_return;
435
+ }
312
436
  } else if (sys >= 0) {
313
437
  /* normal syscall processing */
314
438
  rc = db_rule_add(db, rule);
@@ -10,7 +10,7 @@
10
10
  #include "arch.h"
11
11
  #include "arch-s390x.h"
12
12
 
13
- /* NOTE: based on Linux 4.15-rc7 */
13
+ /* NOTE: based on Linux v5.4-rc4 */
14
14
  const struct arch_syscall_def s390x_syscall_table[] = { \
15
15
  { "_llseek", __PNR__llseek },
16
16
  { "_newselect", __PNR__newselect },
@@ -42,11 +42,17 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
42
42
  { "chown32", __PNR_chown32 },
43
43
  { "chroot", 61 },
44
44
  { "clock_adjtime", 337 },
45
+ { "clock_adjtime64", __PNR_clock_adjtime64 },
45
46
  { "clock_getres", 261 },
47
+ { "clock_getres_time64", __PNR_clock_getres_time64 },
46
48
  { "clock_gettime", 260 },
49
+ { "clock_gettime64", __PNR_clock_gettime64 },
47
50
  { "clock_nanosleep", 262 },
51
+ { "clock_nanosleep_time64", __PNR_clock_nanosleep_time64 },
48
52
  { "clock_settime", 259 },
53
+ { "clock_settime64", __PNR_clock_settime64 },
49
54
  { "clone", 120 },
55
+ { "clone3", 435 },
50
56
  { "close", 6 },
51
57
  { "connect", 362 },
52
58
  { "copy_file_range", 375 },
@@ -90,7 +96,11 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
90
96
  { "flock", 143 },
91
97
  { "fork", 2 },
92
98
  { "fremovexattr", 235 },
99
+ { "fsconfig", 431 },
93
100
  { "fsetxattr", 226 },
101
+ { "fsmount", 432 },
102
+ { "fsopen", 430 },
103
+ { "fspick", 433 },
94
104
  { "fstat", 108 },
95
105
  { "fstat64", __PNR_fstat64 },
96
106
  { "fstatat64", __PNR_fstatat64 },
@@ -101,6 +111,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
101
111
  { "ftruncate", 93 },
102
112
  { "ftruncate64", __PNR_ftruncate64 },
103
113
  { "futex", 238 },
114
+ { "futex_time64", __PNR_futex_time64 },
104
115
  { "futimesat", 292 },
105
116
  { "get_kernel_syms", 130 },
106
117
  { "get_mempolicy", 269 },
@@ -153,8 +164,12 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
153
164
  { "io_destroy", 244 },
154
165
  { "io_getevents", 245 },
155
166
  { "io_pgetevents", 382 },
167
+ { "io_pgetevents_time64", __PNR_io_pgetevents_time64 },
156
168
  { "io_setup", 243 },
157
169
  { "io_submit", 246 },
170
+ { "io_uring_setup", 425 },
171
+ { "io_uring_enter", 426 },
172
+ { "io_uring_register", 427 },
158
173
  { "ioctl", 54 },
159
174
  { "ioperm", __PNR_ioperm},
160
175
  { "iopl", __PNR_iopl },
@@ -198,6 +213,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
198
213
  { "mmap2", __PNR_mmap2 },
199
214
  { "modify_ldt", __PNR_modify_ldt },
200
215
  { "mount", 21 },
216
+ { "move_mount", 429 },
201
217
  { "move_pages", 310 },
202
218
  { "mprotect", 125 },
203
219
  { "mpx", __PNR_mpx },
@@ -205,13 +221,15 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
205
221
  { "mq_notify", 275 },
206
222
  { "mq_open", 271 },
207
223
  { "mq_timedreceive", 274 },
224
+ { "mq_timedreceive_time64", __PNR_mq_timedreceive_time64 },
208
225
  { "mq_timedsend", 273 },
226
+ { "mq_timedsend_time64", __PNR_mq_timedsend_time64 },
209
227
  { "mq_unlink", 272 },
210
228
  { "mremap", 163 },
211
- { "msgctl", __PNR_msgctl },
212
- { "msgget", __PNR_msgget },
213
- { "msgrcv", __PNR_msgrcv },
214
- { "msgsnd", __PNR_msgsnd },
229
+ { "msgctl", 402 },
230
+ { "msgget", 399 },
231
+ { "msgrcv", 401 },
232
+ { "msgsnd", 400 },
215
233
  { "msync", 144 },
216
234
  { "multiplexer", __PNR_multiplexer },
217
235
  { "munlock", 151 },
@@ -230,6 +248,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
230
248
  { "oldwait4", __PNR_oldwait4 },
231
249
  { "open", 5 },
232
250
  { "open_by_handle_at", 336 },
251
+ { "open_tree", 428 },
233
252
  { "openat", 288 },
234
253
  { "pause", 29 },
235
254
  { "pciconfig_iobase", __PNR_pciconfig_iobase },
@@ -237,14 +256,17 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
237
256
  { "pciconfig_write", __PNR_pciconfig_write },
238
257
  { "perf_event_open", 331 },
239
258
  { "personality", 136 },
259
+ { "pidfd_open", 434 },
260
+ { "pidfd_send_signal", 424 },
240
261
  { "pipe", 42 },
241
262
  { "pipe2", 325 },
242
263
  { "pivot_root", 217 },
243
- { "pkey_alloc", __PNR_pkey_alloc },
244
- { "pkey_free", __PNR_pkey_free },
245
- { "pkey_mprotect", __PNR_pkey_mprotect },
264
+ { "pkey_alloc", 385 },
265
+ { "pkey_free", 386 },
266
+ { "pkey_mprotect", 384 },
246
267
  { "poll", 168 },
247
268
  { "ppoll", 302 },
269
+ { "ppoll_time64", __PNR_ppoll_time64 },
248
270
  { "prctl", 172 },
249
271
  { "pread64", 180 },
250
272
  { "preadv", 328 },
@@ -255,6 +277,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
255
277
  { "prof", __PNR_prof },
256
278
  { "profil", __PNR_profil },
257
279
  { "pselect6", 301 },
280
+ { "pselect6_time64", __PNR_pselect6_time64 },
258
281
  { "ptrace", 26 },
259
282
  { "putpmsg", 189 },
260
283
  { "pwrite64", 181 },
@@ -272,6 +295,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
272
295
  { "recv", __PNR_recv },
273
296
  { "recvfrom", 371 },
274
297
  { "recvmmsg", 357 },
298
+ { "recvmmsg_time64", __PNR_recvmmsg_time64 },
275
299
  { "recvmsg", 372 },
276
300
  { "remap_file_pages", 267 },
277
301
  { "removexattr", 233 },
@@ -289,6 +313,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
289
313
  { "rt_sigreturn", 173 },
290
314
  { "rt_sigsuspend", 179 },
291
315
  { "rt_sigtimedwait", 177 },
316
+ { "rt_sigtimedwait_time64", __PNR_rt_sigtimedwait_time64 },
292
317
  { "rt_tgsigqueueinfo", 330 },
293
318
  { "rtas", __PNR_rtas },
294
319
  { "s390_guarded_storage", 378 },
@@ -303,6 +328,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
303
328
  { "sched_getparam", 155 },
304
329
  { "sched_getscheduler", 157 },
305
330
  { "sched_rr_get_interval", 161 },
331
+ { "sched_rr_get_interval_time64", __PNR_sched_rr_get_interval_time64 },
306
332
  { "sched_setaffinity", 239 },
307
333
  { "sched_setattr", 345 },
308
334
  { "sched_setparam", 154 },
@@ -311,10 +337,11 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
311
337
  { "seccomp", 348 },
312
338
  { "security", __PNR_security },
313
339
  { "select", 142 },
314
- { "semctl", __PNR_semctl },
315
- { "semget", __PNR_semget },
340
+ { "semctl", 394 },
341
+ { "semget", 393 },
316
342
  { "semop", __PNR_semop },
317
- { "semtimedop", __PNR_semtimedop },
343
+ { "semtimedop", 392 },
344
+ { "semtimedop_time64", __PNR_semtimedop_time64 },
318
345
  { "send", __PNR_send },
319
346
  { "sendfile", 187 },
320
347
  { "sendfile64", __PNR_sendfile64 },
@@ -356,10 +383,10 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
356
383
  { "setuid32", __PNR_setuid32 },
357
384
  { "setxattr", 224 },
358
385
  { "sgetmask", __PNR_sgetmask },
359
- { "shmat", __PNR_shmat },
360
- { "shmctl", __PNR_shmctl },
361
- { "shmdt", __PNR_shmdt },
362
- { "shmget", __PNR_shmget },
386
+ { "shmat", 397 },
387
+ { "shmctl", 396 },
388
+ { "shmdt", 398 },
389
+ { "shmget", 395 },
363
390
  { "shutdown", 373 },
364
391
  { "sigaction", 67 },
365
392
  { "sigaltstack", 186 },
@@ -408,11 +435,15 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
408
435
  { "timer_delete", 258 },
409
436
  { "timer_getoverrun", 257 },
410
437
  { "timer_gettime", 256 },
438
+ { "timer_gettime64", __PNR_timer_gettime64 },
411
439
  { "timer_settime", 255 },
440
+ { "timer_settime64", __PNR_timer_settime64 },
412
441
  { "timerfd", 317 },
413
442
  { "timerfd_create", 319 },
414
443
  { "timerfd_gettime", 321 },
444
+ { "timerfd_gettime64", __PNR_timerfd_gettime64 },
415
445
  { "timerfd_settime", 320 },
446
+ { "timerfd_settime64", __PNR_timerfd_settime64 },
416
447
  { "times", 43 },
417
448
  { "tkill", 237 },
418
449
  { "truncate", 92 },
@@ -434,6 +465,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
434
465
  { "ustat", 62 },
435
466
  { "utime", 30 },
436
467
  { "utimensat", 315 },
468
+ { "utimensat_time64", __PNR_utimensat_time64 },
437
469
  { "utimes", 313 },
438
470
  { "vfork", 190 },
439
471
  { "vhangup", 111 },
@@ -28,15 +28,15 @@ const struct arch_def arch_def_s390x = {
28
28
 
29
29
  /**
30
30
  * Convert a multiplexed pseudo socket syscall into a direct syscall
31
- * @param socketcall the multiplexed pseudo syscall number
31
+ * @param syscall the multiplexed pseudo syscall number
32
32
  *
33
33
  * Return the related direct syscall number, __NR_SCMP_UNDEF is there is
34
34
  * no related syscall, or __NR_SCMP_ERROR otherwise.
35
35
  *
36
36
  */
37
- static int _s390x_sock_demux(int socketcall)
37
+ static int _s390x_syscall_demux(int syscall)
38
38
  {
39
- switch (socketcall) {
39
+ switch (syscall) {
40
40
  case -101:
41
41
  /* socket */
42
42
  return 359;
@@ -97,6 +97,42 @@ static int _s390x_sock_demux(int socketcall)
97
97
  case -120:
98
98
  /* sendmmsg */
99
99
  return 345;
100
+ case -201:
101
+ /* semop - not defined */
102
+ return __NR_SCMP_UNDEF;
103
+ case -202:
104
+ /* semget */
105
+ return 393;
106
+ case -203:
107
+ /* semctl */
108
+ return 394;
109
+ case -204:
110
+ /* semtimedop */
111
+ return 392;
112
+ case -211:
113
+ /* msgsnd */
114
+ return 400;
115
+ case -212:
116
+ /* msgrcv */
117
+ return 401;
118
+ case -213:
119
+ /* msgget */
120
+ return 399;
121
+ case -214:
122
+ /* msgctl */
123
+ return 402;
124
+ case -221:
125
+ /* shmat */
126
+ return 397;
127
+ case -222:
128
+ /* shmdt */
129
+ return 398;
130
+ case -223:
131
+ /* shmget */
132
+ return 395;
133
+ case -224:
134
+ /* shmctl */
135
+ return 396;
100
136
  }
101
137
 
102
138
  return __NR_SCMP_ERROR;
@@ -110,7 +146,7 @@ static int _s390x_sock_demux(int socketcall)
110
146
  * there is no related pseudo syscall, or __NR_SCMP_ERROR otherwise.
111
147
  *
112
148
  */
113
- static int _s390x_sock_mux(int syscall)
149
+ static int _s390x_syscall_mux(int syscall)
114
150
  {
115
151
  switch (syscall) {
116
152
  case 337:
@@ -164,6 +200,39 @@ static int _s390x_sock_mux(int syscall)
164
200
  case 373:
165
201
  /* shutdown */
166
202
  return -113;
203
+ case 392:
204
+ /* semtimedop */
205
+ return -204;
206
+ case 393:
207
+ /* semget */
208
+ return -202;
209
+ case 394:
210
+ /* semctl */
211
+ return -203;
212
+ case 400:
213
+ /* msgsnd */
214
+ return -211;
215
+ case 401:
216
+ /* msgrcv */
217
+ return -212;
218
+ case 399:
219
+ /* msgget */
220
+ return -213;
221
+ case 402:
222
+ /* msgctl */
223
+ return -214;
224
+ case 397:
225
+ /* shmat */
226
+ return -221;
227
+ case 398:
228
+ /* shmdt */
229
+ return -222;
230
+ case 395:
231
+ /* shmget */
232
+ return -223;
233
+ case 396:
234
+ /* shmctl */
235
+ return -224;
167
236
  }
168
237
 
169
238
  return __NR_SCMP_ERROR;
@@ -228,7 +297,7 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
228
297
 
229
298
  /* determine both the muxed and direct syscall numbers */
230
299
  if (sys > 0) {
231
- sys_a = _s390x_sock_mux(sys);
300
+ sys_a = _s390x_syscall_mux(sys);
232
301
  if (sys_a == __NR_SCMP_ERROR) {
233
302
  rc = __NR_SCMP_ERROR;
234
303
  goto add_return;
@@ -236,7 +305,7 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
236
305
  sys_b = sys;
237
306
  } else {
238
307
  sys_a = sys;
239
- sys_b = _s390x_sock_demux(sys);
308
+ sys_b = _s390x_syscall_demux(sys);
240
309
  if (sys_b == __NR_SCMP_ERROR) {
241
310
  rc = __NR_SCMP_ERROR;
242
311
  goto add_return;
@@ -291,24 +360,81 @@ int s390x_rule_add(struct db_filter *db, struct db_api_rule_list *rule)
291
360
  if (rc < 0)
292
361
  goto add_return;
293
362
  }
294
- } else if (sys <= -200 && sys >= -224) {
295
- /* multiplexed ipc syscalls */
363
+ } else if ((sys <= -200 && sys >= -224) || (sys >= 392 && sys <= 402)) {
364
+ /* (-200 to -224) : multiplexed ipc syscalls
365
+ (392 to 402) : direct ipc syscalls */
366
+
367
+ /* strict check for the multiplexed socket syscalls */
296
368
  for (iter = 0; iter < ARG_COUNT_MAX; iter++) {
297
369
  if ((rule->args[iter].valid != 0) && (rule->strict)) {
298
370
  rc = -EINVAL;
299
371
  goto add_return;
300
372
  }
301
373
  }
302
- rule->args[0].arg = 0;
303
- rule->args[0].op = SCMP_CMP_EQ;
304
- rule->args[0].mask = DATUM_MAX;
305
- rule->args[0].datum = abs(sys) % 200;
306
- rule->args[0].valid = 1;
307
- rule->syscall = __s390x_NR_ipc;
308
374
 
309
- rc = db_rule_add(db, rule);
310
- if (rc < 0)
311
- goto add_return;
375
+ /* determine both the muxed and direct syscall numbers */
376
+ if (sys > 0) {
377
+ sys_a = _s390x_syscall_mux(sys);
378
+ if (sys_a == __NR_SCMP_ERROR) {
379
+ rc = __NR_SCMP_ERROR;
380
+ goto add_return;
381
+ }
382
+ sys_b = sys;
383
+ } else {
384
+ sys_a = sys;
385
+ sys_b = _s390x_syscall_demux(sys);
386
+ if (sys_b == __NR_SCMP_ERROR) {
387
+ rc = __NR_SCMP_ERROR;
388
+ goto add_return;
389
+ }
390
+ }
391
+
392
+ /* use rule_a for the multiplexed syscall and use rule_b for
393
+ * the direct wired syscall */
394
+
395
+ if (sys_a == __NR_SCMP_UNDEF) {
396
+ rule_a = NULL;
397
+ rule_b = rule;
398
+ } else if (sys_b == __NR_SCMP_UNDEF) {
399
+ rule_a = rule;
400
+ rule_b = NULL;
401
+ } else {
402
+ /* need two rules, dup the first and link together */
403
+ rule_a = rule;
404
+ rule_dup = db_rule_dup(rule_a);
405
+ rule_b = rule_dup;
406
+ if (rule_b == NULL)
407
+ goto add_return;
408
+ rule_b->prev = rule_a;
409
+ rule_b->next = NULL;
410
+ rule_a->next = rule_b;
411
+ }
412
+
413
+ /* multiplexed socket syscalls */
414
+ if (rule_a != NULL) {
415
+ rule_a->syscall = __s390x_NR_ipc;
416
+ rule_a->args[0].arg = 0;
417
+ rule_a->args[0].op = SCMP_CMP_EQ;
418
+ rule_a->args[0].mask = DATUM_MAX;
419
+ rule_a->args[0].datum = (-sys_a) % 200;
420
+ rule_a->args[0].valid = 1;
421
+ }
422
+
423
+ /* direct wired socket syscalls */
424
+ if (rule_b != NULL)
425
+ rule_b->syscall = sys_b;
426
+
427
+ /* we should be protected by a transaction checkpoint */
428
+ if (rule_a != NULL) {
429
+ rc = db_rule_add(db, rule_a);
430
+ if (rc < 0)
431
+ goto add_return;
432
+ }
433
+ if (rule_b != NULL) {
434
+ rc = db_rule_add(db, rule_b);
435
+ if (rc < 0)
436
+ goto add_return;
437
+ }
312
438
  } else if (sys >= 0) {
313
439
  /* normal syscall processing */
314
440
  rc = db_rule_add(db, rule);