seccomp: fix decoding of sock_fprog and sock_filter structures
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Apr 2016 00:05:43 +0000 (00:05 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 12 Apr 2016 00:05:43 +0000 (00:05 +0000)
commit6ba947f36e4d56710d09a59115e919bec2232cc5
tree72c924aef5be78357c948356dd9c0e67a589f7d8
parent3ea6a598025303d46da92cde677f6caca5dd536d
seccomp: fix decoding of sock_fprog and sock_filter structures

Always print struct sock_fprog.len.
Fix printing of unfetchable elements in sock_filter array.
Fix printing of large sock_filter arrays.

* seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and
print_seccomp_fprog.
(print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog.
* tests/prctl-seccomp-filter-v.c (main): Update.
* tests/seccomp-filter-v.c: New file.
* tests/seccomp-filter-v.test: New test.
* tests/.gitignore: Add seccomp-filter-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-filter-v.test.
seccomp.c
tests/.gitignore
tests/Makefile.am
tests/prctl-seccomp-filter-v.c
tests/seccomp-filter-v.c [new file with mode: 0644]
tests/seccomp-filter-v.test [new file with mode: 0755]