Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

seccomp.c 1020B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #include "defs.h"
  8. #ifdef HAVE_LINUX_SECCOMP_H
  9. # include <linux/seccomp.h>
  10. #endif
  11. #include "xlat/seccomp_ops.h"
  12. #include "xlat/seccomp_filter_flags.h"
  13. SYS_FUNC(seccomp)
  14. {
  15. unsigned int op = tcp->u_arg[0];
  16. unsigned int flags = tcp->u_arg[1];
  17. unsigned int act;
  18. printxval(seccomp_ops, op, "SECCOMP_SET_MODE_???");
  19. tprints(", ");
  20. switch (op) {
  21. case SECCOMP_GET_ACTION_AVAIL:
  22. tprintf("%u, ", flags);
  23. if (!umove_or_printaddr(tcp, tcp->u_arg[2], &act)) {
  24. tprints("[");
  25. printxval(seccomp_ret_action, act, "SECCOMP_RET_???");
  26. tprints("]");
  27. }
  28. break;
  29. case SECCOMP_SET_MODE_FILTER:
  30. printflags(seccomp_filter_flags, flags,
  31. "SECCOMP_FILTER_FLAG_???");
  32. tprints(", ");
  33. decode_seccomp_fprog(tcp, tcp->u_arg[2]);
  34. break;
  35. case SECCOMP_SET_MODE_STRICT:
  36. default:
  37. tprintf("%u, ", flags);
  38. printaddr(tcp->u_arg[2]);
  39. break;
  40. }
  41. return RVAL_DECODED;
  42. }