Browse code

seccomp: add test for loading old JSON format

Commit 5ff21add06ce0e502b41a194077daad311901996 changed the (JSON) format that's
used for seccomp profiles, but keeping the code backward compatible to allow both
the old or new format.

This patch adds a new test, which loads the old format. It takes the default seccomp
profile before the format was changed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2020/09/28 16:50:03
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,1593 @@
0
+{
1
+  "defaultAction": "SCMP_ACT_ERRNO",
2
+  "architectures": [
3
+    "SCMP_ARCH_X86_64",
4
+    "SCMP_ARCH_X86",
5
+    "SCMP_ARCH_X32"
6
+  ],
7
+  "syscalls": [
8
+    {
9
+      "name": "accept",
10
+      "action": "SCMP_ACT_ALLOW",
11
+      "args": []
12
+    },
13
+    {
14
+      "name": "accept4",
15
+      "action": "SCMP_ACT_ALLOW",
16
+      "args": []
17
+    },
18
+    {
19
+      "name": "access",
20
+      "action": "SCMP_ACT_ALLOW",
21
+      "args": []
22
+    },
23
+    {
24
+      "name": "alarm",
25
+      "action": "SCMP_ACT_ALLOW",
26
+      "args": []
27
+    },
28
+    {
29
+      "name": "bind",
30
+      "action": "SCMP_ACT_ALLOW",
31
+      "args": []
32
+    },
33
+    {
34
+      "name": "brk",
35
+      "action": "SCMP_ACT_ALLOW",
36
+      "args": []
37
+    },
38
+    {
39
+      "name": "capget",
40
+      "action": "SCMP_ACT_ALLOW",
41
+      "args": []
42
+    },
43
+    {
44
+      "name": "capset",
45
+      "action": "SCMP_ACT_ALLOW",
46
+      "args": []
47
+    },
48
+    {
49
+      "name": "chdir",
50
+      "action": "SCMP_ACT_ALLOW",
51
+      "args": []
52
+    },
53
+    {
54
+      "name": "chmod",
55
+      "action": "SCMP_ACT_ALLOW",
56
+      "args": []
57
+    },
58
+    {
59
+      "name": "chown",
60
+      "action": "SCMP_ACT_ALLOW",
61
+      "args": []
62
+    },
63
+    {
64
+      "name": "chown32",
65
+      "action": "SCMP_ACT_ALLOW",
66
+      "args": []
67
+    },
68
+    {
69
+      "name": "clock_getres",
70
+      "action": "SCMP_ACT_ALLOW",
71
+      "args": []
72
+    },
73
+    {
74
+      "name": "clock_gettime",
75
+      "action": "SCMP_ACT_ALLOW",
76
+      "args": []
77
+    },
78
+    {
79
+      "name": "clock_nanosleep",
80
+      "action": "SCMP_ACT_ALLOW",
81
+      "args": []
82
+    },
83
+    {
84
+      "name": "close",
85
+      "action": "SCMP_ACT_ALLOW",
86
+      "args": []
87
+    },
88
+    {
89
+      "name": "connect",
90
+      "action": "SCMP_ACT_ALLOW",
91
+      "args": []
92
+    },
93
+    {
94
+      "name": "copy_file_range",
95
+      "action": "SCMP_ACT_ALLOW",
96
+      "args": []
97
+    },
98
+    {
99
+      "name": "creat",
100
+      "action": "SCMP_ACT_ALLOW",
101
+      "args": []
102
+    },
103
+    {
104
+      "name": "dup",
105
+      "action": "SCMP_ACT_ALLOW",
106
+      "args": []
107
+    },
108
+    {
109
+      "name": "dup2",
110
+      "action": "SCMP_ACT_ALLOW",
111
+      "args": []
112
+    },
113
+    {
114
+      "name": "dup3",
115
+      "action": "SCMP_ACT_ALLOW",
116
+      "args": []
117
+    },
118
+    {
119
+      "name": "epoll_create",
120
+      "action": "SCMP_ACT_ALLOW",
121
+      "args": []
122
+    },
123
+    {
124
+      "name": "epoll_create1",
125
+      "action": "SCMP_ACT_ALLOW",
126
+      "args": []
127
+    },
128
+    {
129
+      "name": "epoll_ctl",
130
+      "action": "SCMP_ACT_ALLOW",
131
+      "args": []
132
+    },
133
+    {
134
+      "name": "epoll_ctl_old",
135
+      "action": "SCMP_ACT_ALLOW",
136
+      "args": []
137
+    },
138
+    {
139
+      "name": "epoll_pwait",
140
+      "action": "SCMP_ACT_ALLOW",
141
+      "args": []
142
+    },
143
+    {
144
+      "name": "epoll_wait",
145
+      "action": "SCMP_ACT_ALLOW",
146
+      "args": []
147
+    },
148
+    {
149
+      "name": "epoll_wait_old",
150
+      "action": "SCMP_ACT_ALLOW",
151
+      "args": []
152
+    },
153
+    {
154
+      "name": "eventfd",
155
+      "action": "SCMP_ACT_ALLOW",
156
+      "args": []
157
+    },
158
+    {
159
+      "name": "eventfd2",
160
+      "action": "SCMP_ACT_ALLOW",
161
+      "args": []
162
+    },
163
+    {
164
+      "name": "execve",
165
+      "action": "SCMP_ACT_ALLOW",
166
+      "args": []
167
+    },
168
+    {
169
+      "name": "execveat",
170
+      "action": "SCMP_ACT_ALLOW",
171
+      "args": []
172
+    },
173
+    {
174
+      "name": "exit",
175
+      "action": "SCMP_ACT_ALLOW",
176
+      "args": []
177
+    },
178
+    {
179
+      "name": "exit_group",
180
+      "action": "SCMP_ACT_ALLOW",
181
+      "args": []
182
+    },
183
+    {
184
+      "name": "faccessat",
185
+      "action": "SCMP_ACT_ALLOW",
186
+      "args": []
187
+    },
188
+    {
189
+      "name": "fadvise64",
190
+      "action": "SCMP_ACT_ALLOW",
191
+      "args": []
192
+    },
193
+    {
194
+      "name": "fadvise64_64",
195
+      "action": "SCMP_ACT_ALLOW",
196
+      "args": []
197
+    },
198
+    {
199
+      "name": "fallocate",
200
+      "action": "SCMP_ACT_ALLOW",
201
+      "args": []
202
+    },
203
+    {
204
+      "name": "fanotify_mark",
205
+      "action": "SCMP_ACT_ALLOW",
206
+      "args": []
207
+    },
208
+    {
209
+      "name": "fchdir",
210
+      "action": "SCMP_ACT_ALLOW",
211
+      "args": []
212
+    },
213
+    {
214
+      "name": "fchmod",
215
+      "action": "SCMP_ACT_ALLOW",
216
+      "args": []
217
+    },
218
+    {
219
+      "name": "fchmodat",
220
+      "action": "SCMP_ACT_ALLOW",
221
+      "args": []
222
+    },
223
+    {
224
+      "name": "fchown",
225
+      "action": "SCMP_ACT_ALLOW",
226
+      "args": []
227
+    },
228
+    {
229
+      "name": "fchown32",
230
+      "action": "SCMP_ACT_ALLOW",
231
+      "args": []
232
+    },
233
+    {
234
+      "name": "fchownat",
235
+      "action": "SCMP_ACT_ALLOW",
236
+      "args": []
237
+    },
238
+    {
239
+      "name": "fcntl",
240
+      "action": "SCMP_ACT_ALLOW",
241
+      "args": []
242
+    },
243
+    {
244
+      "name": "fcntl64",
245
+      "action": "SCMP_ACT_ALLOW",
246
+      "args": []
247
+    },
248
+    {
249
+      "name": "fdatasync",
250
+      "action": "SCMP_ACT_ALLOW",
251
+      "args": []
252
+    },
253
+    {
254
+      "name": "fgetxattr",
255
+      "action": "SCMP_ACT_ALLOW",
256
+      "args": []
257
+    },
258
+    {
259
+      "name": "flistxattr",
260
+      "action": "SCMP_ACT_ALLOW",
261
+      "args": []
262
+    },
263
+    {
264
+      "name": "flock",
265
+      "action": "SCMP_ACT_ALLOW",
266
+      "args": []
267
+    },
268
+    {
269
+      "name": "fork",
270
+      "action": "SCMP_ACT_ALLOW",
271
+      "args": []
272
+    },
273
+    {
274
+      "name": "fremovexattr",
275
+      "action": "SCMP_ACT_ALLOW",
276
+      "args": []
277
+    },
278
+    {
279
+      "name": "fsetxattr",
280
+      "action": "SCMP_ACT_ALLOW",
281
+      "args": []
282
+    },
283
+    {
284
+      "name": "fstat",
285
+      "action": "SCMP_ACT_ALLOW",
286
+      "args": []
287
+    },
288
+    {
289
+      "name": "fstat64",
290
+      "action": "SCMP_ACT_ALLOW",
291
+      "args": []
292
+    },
293
+    {
294
+      "name": "fstatat64",
295
+      "action": "SCMP_ACT_ALLOW",
296
+      "args": []
297
+    },
298
+    {
299
+      "name": "fstatfs",
300
+      "action": "SCMP_ACT_ALLOW",
301
+      "args": []
302
+    },
303
+    {
304
+      "name": "fstatfs64",
305
+      "action": "SCMP_ACT_ALLOW",
306
+      "args": []
307
+    },
308
+    {
309
+      "name": "fsync",
310
+      "action": "SCMP_ACT_ALLOW",
311
+      "args": []
312
+    },
313
+    {
314
+      "name": "ftruncate",
315
+      "action": "SCMP_ACT_ALLOW",
316
+      "args": []
317
+    },
318
+    {
319
+      "name": "ftruncate64",
320
+      "action": "SCMP_ACT_ALLOW",
321
+      "args": []
322
+    },
323
+    {
324
+      "name": "futex",
325
+      "action": "SCMP_ACT_ALLOW",
326
+      "args": []
327
+    },
328
+    {
329
+      "name": "futimesat",
330
+      "action": "SCMP_ACT_ALLOW",
331
+      "args": []
332
+    },
333
+    {
334
+      "name": "getcpu",
335
+      "action": "SCMP_ACT_ALLOW",
336
+      "args": []
337
+    },
338
+    {
339
+      "name": "getcwd",
340
+      "action": "SCMP_ACT_ALLOW",
341
+      "args": []
342
+    },
343
+    {
344
+      "name": "getdents",
345
+      "action": "SCMP_ACT_ALLOW",
346
+      "args": []
347
+    },
348
+    {
349
+      "name": "getdents64",
350
+      "action": "SCMP_ACT_ALLOW",
351
+      "args": []
352
+    },
353
+    {
354
+      "name": "getegid",
355
+      "action": "SCMP_ACT_ALLOW",
356
+      "args": []
357
+    },
358
+    {
359
+      "name": "getegid32",
360
+      "action": "SCMP_ACT_ALLOW",
361
+      "args": []
362
+    },
363
+    {
364
+      "name": "geteuid",
365
+      "action": "SCMP_ACT_ALLOW",
366
+      "args": []
367
+    },
368
+    {
369
+      "name": "geteuid32",
370
+      "action": "SCMP_ACT_ALLOW",
371
+      "args": []
372
+    },
373
+    {
374
+      "name": "getgid",
375
+      "action": "SCMP_ACT_ALLOW",
376
+      "args": []
377
+    },
378
+    {
379
+      "name": "getgid32",
380
+      "action": "SCMP_ACT_ALLOW",
381
+      "args": []
382
+    },
383
+    {
384
+      "name": "getgroups",
385
+      "action": "SCMP_ACT_ALLOW",
386
+      "args": []
387
+    },
388
+    {
389
+      "name": "getgroups32",
390
+      "action": "SCMP_ACT_ALLOW",
391
+      "args": []
392
+    },
393
+    {
394
+      "name": "getitimer",
395
+      "action": "SCMP_ACT_ALLOW",
396
+      "args": []
397
+    },
398
+    {
399
+      "name": "getpeername",
400
+      "action": "SCMP_ACT_ALLOW",
401
+      "args": []
402
+    },
403
+    {
404
+      "name": "getpgid",
405
+      "action": "SCMP_ACT_ALLOW",
406
+      "args": []
407
+    },
408
+    {
409
+      "name": "getpgrp",
410
+      "action": "SCMP_ACT_ALLOW",
411
+      "args": []
412
+    },
413
+    {
414
+      "name": "getpid",
415
+      "action": "SCMP_ACT_ALLOW",
416
+      "args": []
417
+    },
418
+    {
419
+      "name": "getppid",
420
+      "action": "SCMP_ACT_ALLOW",
421
+      "args": []
422
+    },
423
+    {
424
+      "name": "getpriority",
425
+      "action": "SCMP_ACT_ALLOW",
426
+      "args": []
427
+    },
428
+    {
429
+      "name": "getrandom",
430
+      "action": "SCMP_ACT_ALLOW",
431
+      "args": []
432
+    },
433
+    {
434
+      "name": "getresgid",
435
+      "action": "SCMP_ACT_ALLOW",
436
+      "args": []
437
+    },
438
+    {
439
+      "name": "getresgid32",
440
+      "action": "SCMP_ACT_ALLOW",
441
+      "args": []
442
+    },
443
+    {
444
+      "name": "getresuid",
445
+      "action": "SCMP_ACT_ALLOW",
446
+      "args": []
447
+    },
448
+    {
449
+      "name": "getresuid32",
450
+      "action": "SCMP_ACT_ALLOW",
451
+      "args": []
452
+    },
453
+    {
454
+      "name": "getrlimit",
455
+      "action": "SCMP_ACT_ALLOW",
456
+      "args": []
457
+    },
458
+    {
459
+      "name": "get_robust_list",
460
+      "action": "SCMP_ACT_ALLOW",
461
+      "args": []
462
+    },
463
+    {
464
+      "name": "getrusage",
465
+      "action": "SCMP_ACT_ALLOW",
466
+      "args": []
467
+    },
468
+    {
469
+      "name": "getsid",
470
+      "action": "SCMP_ACT_ALLOW",
471
+      "args": []
472
+    },
473
+    {
474
+      "name": "getsockname",
475
+      "action": "SCMP_ACT_ALLOW",
476
+      "args": []
477
+    },
478
+    {
479
+      "name": "getsockopt",
480
+      "action": "SCMP_ACT_ALLOW",
481
+      "args": []
482
+    },
483
+    {
484
+      "name": "get_thread_area",
485
+      "action": "SCMP_ACT_ALLOW",
486
+      "args": []
487
+    },
488
+    {
489
+      "name": "gettid",
490
+      "action": "SCMP_ACT_ALLOW",
491
+      "args": []
492
+    },
493
+    {
494
+      "name": "gettimeofday",
495
+      "action": "SCMP_ACT_ALLOW",
496
+      "args": []
497
+    },
498
+    {
499
+      "name": "getuid",
500
+      "action": "SCMP_ACT_ALLOW",
501
+      "args": []
502
+    },
503
+    {
504
+      "name": "getuid32",
505
+      "action": "SCMP_ACT_ALLOW",
506
+      "args": []
507
+    },
508
+    {
509
+      "name": "getxattr",
510
+      "action": "SCMP_ACT_ALLOW",
511
+      "args": []
512
+    },
513
+    {
514
+      "name": "inotify_add_watch",
515
+      "action": "SCMP_ACT_ALLOW",
516
+      "args": []
517
+    },
518
+    {
519
+      "name": "inotify_init",
520
+      "action": "SCMP_ACT_ALLOW",
521
+      "args": []
522
+    },
523
+    {
524
+      "name": "inotify_init1",
525
+      "action": "SCMP_ACT_ALLOW",
526
+      "args": []
527
+    },
528
+    {
529
+      "name": "inotify_rm_watch",
530
+      "action": "SCMP_ACT_ALLOW",
531
+      "args": []
532
+    },
533
+    {
534
+      "name": "io_cancel",
535
+      "action": "SCMP_ACT_ALLOW",
536
+      "args": []
537
+    },
538
+    {
539
+      "name": "ioctl",
540
+      "action": "SCMP_ACT_ALLOW",
541
+      "args": []
542
+    },
543
+    {
544
+      "name": "io_destroy",
545
+      "action": "SCMP_ACT_ALLOW",
546
+      "args": []
547
+    },
548
+    {
549
+      "name": "io_getevents",
550
+      "action": "SCMP_ACT_ALLOW",
551
+      "args": []
552
+    },
553
+    {
554
+      "name": "ioprio_get",
555
+      "action": "SCMP_ACT_ALLOW",
556
+      "args": []
557
+    },
558
+    {
559
+      "name": "ioprio_set",
560
+      "action": "SCMP_ACT_ALLOW",
561
+      "args": []
562
+    },
563
+    {
564
+      "name": "io_setup",
565
+      "action": "SCMP_ACT_ALLOW",
566
+      "args": []
567
+    },
568
+    {
569
+      "name": "io_submit",
570
+      "action": "SCMP_ACT_ALLOW",
571
+      "args": []
572
+    },
573
+    {
574
+      "name": "ipc",
575
+      "action": "SCMP_ACT_ALLOW",
576
+      "args": []
577
+    },
578
+    {
579
+      "name": "kill",
580
+      "action": "SCMP_ACT_ALLOW",
581
+      "args": []
582
+    },
583
+    {
584
+      "name": "lchown",
585
+      "action": "SCMP_ACT_ALLOW",
586
+      "args": []
587
+    },
588
+    {
589
+      "name": "lchown32",
590
+      "action": "SCMP_ACT_ALLOW",
591
+      "args": []
592
+    },
593
+    {
594
+      "name": "lgetxattr",
595
+      "action": "SCMP_ACT_ALLOW",
596
+      "args": []
597
+    },
598
+    {
599
+      "name": "link",
600
+      "action": "SCMP_ACT_ALLOW",
601
+      "args": []
602
+    },
603
+    {
604
+      "name": "linkat",
605
+      "action": "SCMP_ACT_ALLOW",
606
+      "args": []
607
+    },
608
+    {
609
+      "name": "listen",
610
+      "action": "SCMP_ACT_ALLOW",
611
+      "args": []
612
+    },
613
+    {
614
+      "name": "listxattr",
615
+      "action": "SCMP_ACT_ALLOW",
616
+      "args": []
617
+    },
618
+    {
619
+      "name": "llistxattr",
620
+      "action": "SCMP_ACT_ALLOW",
621
+      "args": []
622
+    },
623
+    {
624
+      "name": "_llseek",
625
+      "action": "SCMP_ACT_ALLOW",
626
+      "args": []
627
+    },
628
+    {
629
+      "name": "lremovexattr",
630
+      "action": "SCMP_ACT_ALLOW",
631
+      "args": []
632
+    },
633
+    {
634
+      "name": "lseek",
635
+      "action": "SCMP_ACT_ALLOW",
636
+      "args": []
637
+    },
638
+    {
639
+      "name": "lsetxattr",
640
+      "action": "SCMP_ACT_ALLOW",
641
+      "args": []
642
+    },
643
+    {
644
+      "name": "lstat",
645
+      "action": "SCMP_ACT_ALLOW",
646
+      "args": []
647
+    },
648
+    {
649
+      "name": "lstat64",
650
+      "action": "SCMP_ACT_ALLOW",
651
+      "args": []
652
+    },
653
+    {
654
+      "name": "madvise",
655
+      "action": "SCMP_ACT_ALLOW",
656
+      "args": []
657
+    },
658
+    {
659
+      "name": "memfd_create",
660
+      "action": "SCMP_ACT_ALLOW",
661
+      "args": []
662
+    },
663
+    {
664
+      "name": "mincore",
665
+      "action": "SCMP_ACT_ALLOW",
666
+      "args": []
667
+    },
668
+    {
669
+      "name": "mkdir",
670
+      "action": "SCMP_ACT_ALLOW",
671
+      "args": []
672
+    },
673
+    {
674
+      "name": "mkdirat",
675
+      "action": "SCMP_ACT_ALLOW",
676
+      "args": []
677
+    },
678
+    {
679
+      "name": "mknod",
680
+      "action": "SCMP_ACT_ALLOW",
681
+      "args": []
682
+    },
683
+    {
684
+      "name": "mknodat",
685
+      "action": "SCMP_ACT_ALLOW",
686
+      "args": []
687
+    },
688
+    {
689
+      "name": "mlock",
690
+      "action": "SCMP_ACT_ALLOW",
691
+      "args": []
692
+    },
693
+    {
694
+      "name": "mlock2",
695
+      "action": "SCMP_ACT_ALLOW",
696
+      "args": []
697
+    },
698
+    {
699
+      "name": "mlockall",
700
+      "action": "SCMP_ACT_ALLOW",
701
+      "args": []
702
+    },
703
+    {
704
+      "name": "mmap",
705
+      "action": "SCMP_ACT_ALLOW",
706
+      "args": []
707
+    },
708
+    {
709
+      "name": "mmap2",
710
+      "action": "SCMP_ACT_ALLOW",
711
+      "args": []
712
+    },
713
+    {
714
+      "name": "mprotect",
715
+      "action": "SCMP_ACT_ALLOW",
716
+      "args": []
717
+    },
718
+    {
719
+      "name": "mq_getsetattr",
720
+      "action": "SCMP_ACT_ALLOW",
721
+      "args": []
722
+    },
723
+    {
724
+      "name": "mq_notify",
725
+      "action": "SCMP_ACT_ALLOW",
726
+      "args": []
727
+    },
728
+    {
729
+      "name": "mq_open",
730
+      "action": "SCMP_ACT_ALLOW",
731
+      "args": []
732
+    },
733
+    {
734
+      "name": "mq_timedreceive",
735
+      "action": "SCMP_ACT_ALLOW",
736
+      "args": []
737
+    },
738
+    {
739
+      "name": "mq_timedsend",
740
+      "action": "SCMP_ACT_ALLOW",
741
+      "args": []
742
+    },
743
+    {
744
+      "name": "mq_unlink",
745
+      "action": "SCMP_ACT_ALLOW",
746
+      "args": []
747
+    },
748
+    {
749
+      "name": "mremap",
750
+      "action": "SCMP_ACT_ALLOW",
751
+      "args": []
752
+    },
753
+    {
754
+      "name": "msgctl",
755
+      "action": "SCMP_ACT_ALLOW",
756
+      "args": []
757
+    },
758
+    {
759
+      "name": "msgget",
760
+      "action": "SCMP_ACT_ALLOW",
761
+      "args": []
762
+    },
763
+    {
764
+      "name": "msgrcv",
765
+      "action": "SCMP_ACT_ALLOW",
766
+      "args": []
767
+    },
768
+    {
769
+      "name": "msgsnd",
770
+      "action": "SCMP_ACT_ALLOW",
771
+      "args": []
772
+    },
773
+    {
774
+      "name": "msync",
775
+      "action": "SCMP_ACT_ALLOW",
776
+      "args": []
777
+    },
778
+    {
779
+      "name": "munlock",
780
+      "action": "SCMP_ACT_ALLOW",
781
+      "args": []
782
+    },
783
+    {
784
+      "name": "munlockall",
785
+      "action": "SCMP_ACT_ALLOW",
786
+      "args": []
787
+    },
788
+    {
789
+      "name": "munmap",
790
+      "action": "SCMP_ACT_ALLOW",
791
+      "args": []
792
+    },
793
+    {
794
+      "name": "nanosleep",
795
+      "action": "SCMP_ACT_ALLOW",
796
+      "args": []
797
+    },
798
+    {
799
+      "name": "newfstatat",
800
+      "action": "SCMP_ACT_ALLOW",
801
+      "args": []
802
+    },
803
+    {
804
+      "name": "_newselect",
805
+      "action": "SCMP_ACT_ALLOW",
806
+      "args": []
807
+    },
808
+    {
809
+      "name": "open",
810
+      "action": "SCMP_ACT_ALLOW",
811
+      "args": []
812
+    },
813
+    {
814
+      "name": "openat",
815
+      "action": "SCMP_ACT_ALLOW",
816
+      "args": []
817
+    },
818
+    {
819
+      "name": "pause",
820
+      "action": "SCMP_ACT_ALLOW",
821
+      "args": []
822
+    },
823
+    {
824
+      "name": "personality",
825
+      "action": "SCMP_ACT_ALLOW",
826
+      "args": [
827
+        {
828
+          "index": 0,
829
+          "value": 0,
830
+          "valueTwo": 0,
831
+          "op": "SCMP_CMP_EQ"
832
+        }
833
+      ]
834
+    },
835
+    {
836
+      "name": "personality",
837
+      "action": "SCMP_ACT_ALLOW",
838
+      "args": [
839
+        {
840
+          "index": 0,
841
+          "value": 8,
842
+          "valueTwo": 0,
843
+          "op": "SCMP_CMP_EQ"
844
+        }
845
+      ]
846
+    },
847
+    {
848
+      "name": "personality",
849
+      "action": "SCMP_ACT_ALLOW",
850
+      "args": [
851
+        {
852
+          "index": 0,
853
+          "value": 4294967295,
854
+          "valueTwo": 0,
855
+          "op": "SCMP_CMP_EQ"
856
+        }
857
+      ]
858
+    },
859
+    {
860
+      "name": "pipe",
861
+      "action": "SCMP_ACT_ALLOW",
862
+      "args": []
863
+    },
864
+    {
865
+      "name": "pipe2",
866
+      "action": "SCMP_ACT_ALLOW",
867
+      "args": []
868
+    },
869
+    {
870
+      "name": "poll",
871
+      "action": "SCMP_ACT_ALLOW",
872
+      "args": []
873
+    },
874
+    {
875
+      "name": "ppoll",
876
+      "action": "SCMP_ACT_ALLOW",
877
+      "args": []
878
+    },
879
+    {
880
+      "name": "prctl",
881
+      "action": "SCMP_ACT_ALLOW",
882
+      "args": []
883
+    },
884
+    {
885
+      "name": "pread64",
886
+      "action": "SCMP_ACT_ALLOW",
887
+      "args": []
888
+    },
889
+    {
890
+      "name": "preadv",
891
+      "action": "SCMP_ACT_ALLOW",
892
+      "args": []
893
+    },
894
+    {
895
+      "name": "prlimit64",
896
+      "action": "SCMP_ACT_ALLOW",
897
+      "args": []
898
+    },
899
+    {
900
+      "name": "pselect6",
901
+      "action": "SCMP_ACT_ALLOW",
902
+      "args": []
903
+    },
904
+    {
905
+      "name": "pwrite64",
906
+      "action": "SCMP_ACT_ALLOW",
907
+      "args": []
908
+    },
909
+    {
910
+      "name": "pwritev",
911
+      "action": "SCMP_ACT_ALLOW",
912
+      "args": []
913
+    },
914
+    {
915
+      "name": "read",
916
+      "action": "SCMP_ACT_ALLOW",
917
+      "args": []
918
+    },
919
+    {
920
+      "name": "readahead",
921
+      "action": "SCMP_ACT_ALLOW",
922
+      "args": []
923
+    },
924
+    {
925
+      "name": "readlink",
926
+      "action": "SCMP_ACT_ALLOW",
927
+      "args": []
928
+    },
929
+    {
930
+      "name": "readlinkat",
931
+      "action": "SCMP_ACT_ALLOW",
932
+      "args": []
933
+    },
934
+    {
935
+      "name": "readv",
936
+      "action": "SCMP_ACT_ALLOW",
937
+      "args": []
938
+    },
939
+    {
940
+      "name": "recv",
941
+      "action": "SCMP_ACT_ALLOW",
942
+      "args": []
943
+    },
944
+    {
945
+      "name": "recvfrom",
946
+      "action": "SCMP_ACT_ALLOW",
947
+      "args": []
948
+    },
949
+    {
950
+      "name": "recvmmsg",
951
+      "action": "SCMP_ACT_ALLOW",
952
+      "args": []
953
+    },
954
+    {
955
+      "name": "recvmsg",
956
+      "action": "SCMP_ACT_ALLOW",
957
+      "args": []
958
+    },
959
+    {
960
+      "name": "remap_file_pages",
961
+      "action": "SCMP_ACT_ALLOW",
962
+      "args": []
963
+    },
964
+    {
965
+      "name": "removexattr",
966
+      "action": "SCMP_ACT_ALLOW",
967
+      "args": []
968
+    },
969
+    {
970
+      "name": "rename",
971
+      "action": "SCMP_ACT_ALLOW",
972
+      "args": []
973
+    },
974
+    {
975
+      "name": "renameat",
976
+      "action": "SCMP_ACT_ALLOW",
977
+      "args": []
978
+    },
979
+    {
980
+      "name": "renameat2",
981
+      "action": "SCMP_ACT_ALLOW",
982
+      "args": []
983
+    },
984
+    {
985
+      "name": "restart_syscall",
986
+      "action": "SCMP_ACT_ALLOW",
987
+      "args": []
988
+    },
989
+    {
990
+      "name": "rmdir",
991
+      "action": "SCMP_ACT_ALLOW",
992
+      "args": []
993
+    },
994
+    {
995
+      "name": "rt_sigaction",
996
+      "action": "SCMP_ACT_ALLOW",
997
+      "args": []
998
+    },
999
+    {
1000
+      "name": "rt_sigpending",
1001
+      "action": "SCMP_ACT_ALLOW",
1002
+      "args": []
1003
+    },
1004
+    {
1005
+      "name": "rt_sigprocmask",
1006
+      "action": "SCMP_ACT_ALLOW",
1007
+      "args": []
1008
+    },
1009
+    {
1010
+      "name": "rt_sigqueueinfo",
1011
+      "action": "SCMP_ACT_ALLOW",
1012
+      "args": []
1013
+    },
1014
+    {
1015
+      "name": "rt_sigreturn",
1016
+      "action": "SCMP_ACT_ALLOW",
1017
+      "args": []
1018
+    },
1019
+    {
1020
+      "name": "rt_sigsuspend",
1021
+      "action": "SCMP_ACT_ALLOW",
1022
+      "args": []
1023
+    },
1024
+    {
1025
+      "name": "rt_sigtimedwait",
1026
+      "action": "SCMP_ACT_ALLOW",
1027
+      "args": []
1028
+    },
1029
+    {
1030
+      "name": "rt_tgsigqueueinfo",
1031
+      "action": "SCMP_ACT_ALLOW",
1032
+      "args": []
1033
+    },
1034
+    {
1035
+      "name": "sched_getaffinity",
1036
+      "action": "SCMP_ACT_ALLOW",
1037
+      "args": []
1038
+    },
1039
+    {
1040
+      "name": "sched_getattr",
1041
+      "action": "SCMP_ACT_ALLOW",
1042
+      "args": []
1043
+    },
1044
+    {
1045
+      "name": "sched_getparam",
1046
+      "action": "SCMP_ACT_ALLOW",
1047
+      "args": []
1048
+    },
1049
+    {
1050
+      "name": "sched_get_priority_max",
1051
+      "action": "SCMP_ACT_ALLOW",
1052
+      "args": []
1053
+    },
1054
+    {
1055
+      "name": "sched_get_priority_min",
1056
+      "action": "SCMP_ACT_ALLOW",
1057
+      "args": []
1058
+    },
1059
+    {
1060
+      "name": "sched_getscheduler",
1061
+      "action": "SCMP_ACT_ALLOW",
1062
+      "args": []
1063
+    },
1064
+    {
1065
+      "name": "sched_rr_get_interval",
1066
+      "action": "SCMP_ACT_ALLOW",
1067
+      "args": []
1068
+    },
1069
+    {
1070
+      "name": "sched_setaffinity",
1071
+      "action": "SCMP_ACT_ALLOW",
1072
+      "args": []
1073
+    },
1074
+    {
1075
+      "name": "sched_setattr",
1076
+      "action": "SCMP_ACT_ALLOW",
1077
+      "args": []
1078
+    },
1079
+    {
1080
+      "name": "sched_setparam",
1081
+      "action": "SCMP_ACT_ALLOW",
1082
+      "args": []
1083
+    },
1084
+    {
1085
+      "name": "sched_setscheduler",
1086
+      "action": "SCMP_ACT_ALLOW",
1087
+      "args": []
1088
+    },
1089
+    {
1090
+      "name": "sched_yield",
1091
+      "action": "SCMP_ACT_ALLOW",
1092
+      "args": []
1093
+    },
1094
+    {
1095
+      "name": "seccomp",
1096
+      "action": "SCMP_ACT_ALLOW",
1097
+      "args": []
1098
+    },
1099
+    {
1100
+      "name": "select",
1101
+      "action": "SCMP_ACT_ALLOW",
1102
+      "args": []
1103
+    },
1104
+    {
1105
+      "name": "semctl",
1106
+      "action": "SCMP_ACT_ALLOW",
1107
+      "args": []
1108
+    },
1109
+    {
1110
+      "name": "semget",
1111
+      "action": "SCMP_ACT_ALLOW",
1112
+      "args": []
1113
+    },
1114
+    {
1115
+      "name": "semop",
1116
+      "action": "SCMP_ACT_ALLOW",
1117
+      "args": []
1118
+    },
1119
+    {
1120
+      "name": "semtimedop",
1121
+      "action": "SCMP_ACT_ALLOW",
1122
+      "args": []
1123
+    },
1124
+    {
1125
+      "name": "send",
1126
+      "action": "SCMP_ACT_ALLOW",
1127
+      "args": []
1128
+    },
1129
+    {
1130
+      "name": "sendfile",
1131
+      "action": "SCMP_ACT_ALLOW",
1132
+      "args": []
1133
+    },
1134
+    {
1135
+      "name": "sendfile64",
1136
+      "action": "SCMP_ACT_ALLOW",
1137
+      "args": []
1138
+    },
1139
+    {
1140
+      "name": "sendmmsg",
1141
+      "action": "SCMP_ACT_ALLOW",
1142
+      "args": []
1143
+    },
1144
+    {
1145
+      "name": "sendmsg",
1146
+      "action": "SCMP_ACT_ALLOW",
1147
+      "args": []
1148
+    },
1149
+    {
1150
+      "name": "sendto",
1151
+      "action": "SCMP_ACT_ALLOW",
1152
+      "args": []
1153
+    },
1154
+    {
1155
+      "name": "setfsgid",
1156
+      "action": "SCMP_ACT_ALLOW",
1157
+      "args": []
1158
+    },
1159
+    {
1160
+      "name": "setfsgid32",
1161
+      "action": "SCMP_ACT_ALLOW",
1162
+      "args": []
1163
+    },
1164
+    {
1165
+      "name": "setfsuid",
1166
+      "action": "SCMP_ACT_ALLOW",
1167
+      "args": []
1168
+    },
1169
+    {
1170
+      "name": "setfsuid32",
1171
+      "action": "SCMP_ACT_ALLOW",
1172
+      "args": []
1173
+    },
1174
+    {
1175
+      "name": "setgid",
1176
+      "action": "SCMP_ACT_ALLOW",
1177
+      "args": []
1178
+    },
1179
+    {
1180
+      "name": "setgid32",
1181
+      "action": "SCMP_ACT_ALLOW",
1182
+      "args": []
1183
+    },
1184
+    {
1185
+      "name": "setgroups",
1186
+      "action": "SCMP_ACT_ALLOW",
1187
+      "args": []
1188
+    },
1189
+    {
1190
+      "name": "setgroups32",
1191
+      "action": "SCMP_ACT_ALLOW",
1192
+      "args": []
1193
+    },
1194
+    {
1195
+      "name": "setitimer",
1196
+      "action": "SCMP_ACT_ALLOW",
1197
+      "args": []
1198
+    },
1199
+    {
1200
+      "name": "setpgid",
1201
+      "action": "SCMP_ACT_ALLOW",
1202
+      "args": []
1203
+    },
1204
+    {
1205
+      "name": "setpriority",
1206
+      "action": "SCMP_ACT_ALLOW",
1207
+      "args": []
1208
+    },
1209
+    {
1210
+      "name": "setregid",
1211
+      "action": "SCMP_ACT_ALLOW",
1212
+      "args": []
1213
+    },
1214
+    {
1215
+      "name": "setregid32",
1216
+      "action": "SCMP_ACT_ALLOW",
1217
+      "args": []
1218
+    },
1219
+    {
1220
+      "name": "setresgid",
1221
+      "action": "SCMP_ACT_ALLOW",
1222
+      "args": []
1223
+    },
1224
+    {
1225
+      "name": "setresgid32",
1226
+      "action": "SCMP_ACT_ALLOW",
1227
+      "args": []
1228
+    },
1229
+    {
1230
+      "name": "setresuid",
1231
+      "action": "SCMP_ACT_ALLOW",
1232
+      "args": []
1233
+    },
1234
+    {
1235
+      "name": "setresuid32",
1236
+      "action": "SCMP_ACT_ALLOW",
1237
+      "args": []
1238
+    },
1239
+    {
1240
+      "name": "setreuid",
1241
+      "action": "SCMP_ACT_ALLOW",
1242
+      "args": []
1243
+    },
1244
+    {
1245
+      "name": "setreuid32",
1246
+      "action": "SCMP_ACT_ALLOW",
1247
+      "args": []
1248
+    },
1249
+    {
1250
+      "name": "setrlimit",
1251
+      "action": "SCMP_ACT_ALLOW",
1252
+      "args": []
1253
+    },
1254
+    {
1255
+      "name": "set_robust_list",
1256
+      "action": "SCMP_ACT_ALLOW",
1257
+      "args": []
1258
+    },
1259
+    {
1260
+      "name": "setsid",
1261
+      "action": "SCMP_ACT_ALLOW",
1262
+      "args": []
1263
+    },
1264
+    {
1265
+      "name": "setsockopt",
1266
+      "action": "SCMP_ACT_ALLOW",
1267
+      "args": []
1268
+    },
1269
+    {
1270
+      "name": "set_thread_area",
1271
+      "action": "SCMP_ACT_ALLOW",
1272
+      "args": []
1273
+    },
1274
+    {
1275
+      "name": "set_tid_address",
1276
+      "action": "SCMP_ACT_ALLOW",
1277
+      "args": []
1278
+    },
1279
+    {
1280
+      "name": "setuid",
1281
+      "action": "SCMP_ACT_ALLOW",
1282
+      "args": []
1283
+    },
1284
+    {
1285
+      "name": "setuid32",
1286
+      "action": "SCMP_ACT_ALLOW",
1287
+      "args": []
1288
+    },
1289
+    {
1290
+      "name": "setxattr",
1291
+      "action": "SCMP_ACT_ALLOW",
1292
+      "args": []
1293
+    },
1294
+    {
1295
+      "name": "shmat",
1296
+      "action": "SCMP_ACT_ALLOW",
1297
+      "args": []
1298
+    },
1299
+    {
1300
+      "name": "shmctl",
1301
+      "action": "SCMP_ACT_ALLOW",
1302
+      "args": []
1303
+    },
1304
+    {
1305
+      "name": "shmdt",
1306
+      "action": "SCMP_ACT_ALLOW",
1307
+      "args": []
1308
+    },
1309
+    {
1310
+      "name": "shmget",
1311
+      "action": "SCMP_ACT_ALLOW",
1312
+      "args": []
1313
+    },
1314
+    {
1315
+      "name": "shutdown",
1316
+      "action": "SCMP_ACT_ALLOW",
1317
+      "args": []
1318
+    },
1319
+    {
1320
+      "name": "sigaltstack",
1321
+      "action": "SCMP_ACT_ALLOW",
1322
+      "args": []
1323
+    },
1324
+    {
1325
+      "name": "signalfd",
1326
+      "action": "SCMP_ACT_ALLOW",
1327
+      "args": []
1328
+    },
1329
+    {
1330
+      "name": "signalfd4",
1331
+      "action": "SCMP_ACT_ALLOW",
1332
+      "args": []
1333
+    },
1334
+    {
1335
+      "name": "sigreturn",
1336
+      "action": "SCMP_ACT_ALLOW",
1337
+      "args": []
1338
+    },
1339
+    {
1340
+      "name": "socket",
1341
+      "action": "SCMP_ACT_ALLOW",
1342
+      "args": []
1343
+    },
1344
+    {
1345
+      "name": "socketcall",
1346
+      "action": "SCMP_ACT_ALLOW",
1347
+      "args": []
1348
+    },
1349
+    {
1350
+      "name": "socketpair",
1351
+      "action": "SCMP_ACT_ALLOW",
1352
+      "args": []
1353
+    },
1354
+    {
1355
+      "name": "splice",
1356
+      "action": "SCMP_ACT_ALLOW",
1357
+      "args": []
1358
+    },
1359
+    {
1360
+      "name": "stat",
1361
+      "action": "SCMP_ACT_ALLOW",
1362
+      "args": []
1363
+    },
1364
+    {
1365
+      "name": "stat64",
1366
+      "action": "SCMP_ACT_ALLOW",
1367
+      "args": []
1368
+    },
1369
+    {
1370
+      "name": "statfs",
1371
+      "action": "SCMP_ACT_ALLOW",
1372
+      "args": []
1373
+    },
1374
+    {
1375
+      "name": "statfs64",
1376
+      "action": "SCMP_ACT_ALLOW",
1377
+      "args": []
1378
+    },
1379
+    {
1380
+      "name": "symlink",
1381
+      "action": "SCMP_ACT_ALLOW",
1382
+      "args": []
1383
+    },
1384
+    {
1385
+      "name": "symlinkat",
1386
+      "action": "SCMP_ACT_ALLOW",
1387
+      "args": []
1388
+    },
1389
+    {
1390
+      "name": "sync",
1391
+      "action": "SCMP_ACT_ALLOW",
1392
+      "args": []
1393
+    },
1394
+    {
1395
+      "name": "sync_file_range",
1396
+      "action": "SCMP_ACT_ALLOW",
1397
+      "args": []
1398
+    },
1399
+    {
1400
+      "name": "syncfs",
1401
+      "action": "SCMP_ACT_ALLOW",
1402
+      "args": []
1403
+    },
1404
+    {
1405
+      "name": "sysinfo",
1406
+      "action": "SCMP_ACT_ALLOW",
1407
+      "args": []
1408
+    },
1409
+    {
1410
+      "name": "syslog",
1411
+      "action": "SCMP_ACT_ALLOW",
1412
+      "args": []
1413
+    },
1414
+    {
1415
+      "name": "tee",
1416
+      "action": "SCMP_ACT_ALLOW",
1417
+      "args": []
1418
+    },
1419
+    {
1420
+      "name": "tgkill",
1421
+      "action": "SCMP_ACT_ALLOW",
1422
+      "args": []
1423
+    },
1424
+    {
1425
+      "name": "time",
1426
+      "action": "SCMP_ACT_ALLOW",
1427
+      "args": []
1428
+    },
1429
+    {
1430
+      "name": "timer_create",
1431
+      "action": "SCMP_ACT_ALLOW",
1432
+      "args": []
1433
+    },
1434
+    {
1435
+      "name": "timer_delete",
1436
+      "action": "SCMP_ACT_ALLOW",
1437
+      "args": []
1438
+    },
1439
+    {
1440
+      "name": "timerfd_create",
1441
+      "action": "SCMP_ACT_ALLOW",
1442
+      "args": []
1443
+    },
1444
+    {
1445
+      "name": "timerfd_gettime",
1446
+      "action": "SCMP_ACT_ALLOW",
1447
+      "args": []
1448
+    },
1449
+    {
1450
+      "name": "timerfd_settime",
1451
+      "action": "SCMP_ACT_ALLOW",
1452
+      "args": []
1453
+    },
1454
+    {
1455
+      "name": "timer_getoverrun",
1456
+      "action": "SCMP_ACT_ALLOW",
1457
+      "args": []
1458
+    },
1459
+    {
1460
+      "name": "timer_gettime",
1461
+      "action": "SCMP_ACT_ALLOW",
1462
+      "args": []
1463
+    },
1464
+    {
1465
+      "name": "timer_settime",
1466
+      "action": "SCMP_ACT_ALLOW",
1467
+      "args": []
1468
+    },
1469
+    {
1470
+      "name": "times",
1471
+      "action": "SCMP_ACT_ALLOW",
1472
+      "args": []
1473
+    },
1474
+    {
1475
+      "name": "tkill",
1476
+      "action": "SCMP_ACT_ALLOW",
1477
+      "args": []
1478
+    },
1479
+    {
1480
+      "name": "truncate",
1481
+      "action": "SCMP_ACT_ALLOW",
1482
+      "args": []
1483
+    },
1484
+    {
1485
+      "name": "truncate64",
1486
+      "action": "SCMP_ACT_ALLOW",
1487
+      "args": []
1488
+    },
1489
+    {
1490
+      "name": "ugetrlimit",
1491
+      "action": "SCMP_ACT_ALLOW",
1492
+      "args": []
1493
+    },
1494
+    {
1495
+      "name": "umask",
1496
+      "action": "SCMP_ACT_ALLOW",
1497
+      "args": []
1498
+    },
1499
+    {
1500
+      "name": "uname",
1501
+      "action": "SCMP_ACT_ALLOW",
1502
+      "args": []
1503
+    },
1504
+    {
1505
+      "name": "unlink",
1506
+      "action": "SCMP_ACT_ALLOW",
1507
+      "args": []
1508
+    },
1509
+    {
1510
+      "name": "unlinkat",
1511
+      "action": "SCMP_ACT_ALLOW",
1512
+      "args": []
1513
+    },
1514
+    {
1515
+      "name": "utime",
1516
+      "action": "SCMP_ACT_ALLOW",
1517
+      "args": []
1518
+    },
1519
+    {
1520
+      "name": "utimensat",
1521
+      "action": "SCMP_ACT_ALLOW",
1522
+      "args": []
1523
+    },
1524
+    {
1525
+      "name": "utimes",
1526
+      "action": "SCMP_ACT_ALLOW",
1527
+      "args": []
1528
+    },
1529
+    {
1530
+      "name": "vfork",
1531
+      "action": "SCMP_ACT_ALLOW",
1532
+      "args": []
1533
+    },
1534
+    {
1535
+      "name": "vmsplice",
1536
+      "action": "SCMP_ACT_ALLOW",
1537
+      "args": []
1538
+    },
1539
+    {
1540
+      "name": "wait4",
1541
+      "action": "SCMP_ACT_ALLOW",
1542
+      "args": []
1543
+    },
1544
+    {
1545
+      "name": "waitid",
1546
+      "action": "SCMP_ACT_ALLOW",
1547
+      "args": []
1548
+    },
1549
+    {
1550
+      "name": "waitpid",
1551
+      "action": "SCMP_ACT_ALLOW",
1552
+      "args": []
1553
+    },
1554
+    {
1555
+      "name": "write",
1556
+      "action": "SCMP_ACT_ALLOW",
1557
+      "args": []
1558
+    },
1559
+    {
1560
+      "name": "writev",
1561
+      "action": "SCMP_ACT_ALLOW",
1562
+      "args": []
1563
+    },
1564
+    {
1565
+      "name": "arch_prctl",
1566
+      "action": "SCMP_ACT_ALLOW",
1567
+      "args": []
1568
+    },
1569
+    {
1570
+      "name": "modify_ldt",
1571
+      "action": "SCMP_ACT_ALLOW",
1572
+      "args": []
1573
+    },
1574
+    {
1575
+      "name": "chroot",
1576
+      "action": "SCMP_ACT_ALLOW",
1577
+      "args": []
1578
+    },
1579
+    {
1580
+      "name": "clone",
1581
+      "action": "SCMP_ACT_ALLOW",
1582
+      "args": [
1583
+        {
1584
+          "index": 0,
1585
+          "value": 2080505856,
1586
+          "valueTwo": 0,
1587
+          "op": "SCMP_CMP_MASKED_EQ"
1588
+        }
1589
+      ]
1590
+    }
1591
+  ]
1592
+}
0 1593
\ No newline at end of file
... ...
@@ -20,6 +20,19 @@ func TestLoadProfile(t *testing.T) {
20 20
 	}
21 21
 }
22 22
 
23
+// TestLoadLegacyProfile tests loading a seccomp profile in the old format
24
+// (before https://github.com/docker/docker/pull/24510)
25
+func TestLoadLegacyProfile(t *testing.T) {
26
+	f, err := ioutil.ReadFile("fixtures/default-old-format.json")
27
+	if err != nil {
28
+		t.Fatal(err)
29
+	}
30
+	rs := oci.DefaultSpec()
31
+	if _, err := LoadProfile(string(f), &rs); err != nil {
32
+		t.Fatal(err)
33
+	}
34
+}
35
+
23 36
 func TestLoadDefaultProfile(t *testing.T) {
24 37
 	f, err := ioutil.ReadFile("default.json")
25 38
 	if err != nil {