Module: SeccompTools::Const::BPF

Included in:
Instruction::Base
Defined in:
lib/seccomp-tools/const.rb

Overview

For BPF / seccomp.

Constant Summary collapse

SIZEOF_SECCOMP_DATA =

sizeof(struct seccomp_data)

64
PR_SET_SECCOMP =

option set seccomp

22
SECCOMP_MODE_FILTER =

filter mode

2
SECCOMP_SET_MODE_FILTER =

For syscall seccomp

1
SECCOMP_RET_ACTION_FULL =

mask of return action

0xffff0000
SECCOMP_RET_DATA =

mask of return data

0x0000ffff
COMMAND =

bpf command classes

{
  ld: 0x0,
  ldx: 0x1,
  st: 0x2,
  stx: 0x3,
  alu: 0x4,
  jmp: 0x5,
  ret: 0x6,
  misc: 0x7
}.freeze
JMP =

types in jmp command

{
  ja: 0x00,
  jeq: 0x10,
  jgt: 0x20,
  jge: 0x30,
  jset: 0x40
}.freeze
SRC =

register

{
  k: 0x0,
  x: 0x8,
  a: 0x10
}.freeze
ACTION =

seccomp action values

{
  KILL_PROCESS: 0x80000000,
  KILL_THREAD: 0x00000000,
  KILL: 0x00000000, # alias of KILL_THREAD
  TRAP: 0x00030000,
  ERRNO: 0x00050000,
  USER_NOTIF: 0x7fc00000,
  LOG: 0x7ffc0000,
  TRACE: 0x7ff00000,
  ALLOW: 0x7fff0000
}.freeze
MODE =

mode used in ld / ldx

{
  imm: 0x00,
  abs: 0x20,
  ind: 0x40,
  mem: 0x60,
  len: 0x80,
  msh: 0xa0
}.freeze
OP =

operation for alu

{
  add: 0x00,
  sub: 0x10,
  mul: 0x20,
  div: 0x30,
  or: 0x40,
  and: 0x50,
  lsh: 0x60,
  rsh: 0x70,
  neg: 0x80,
  # mod: 0x90, # not support
  xor: 0xa0
}.freeze
MISCOP =

operation for misc

{
  tax: 0x00,
  txa: 0x80
}.freeze