cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

d_path.c (1051B)


      1{
      2	"d_path accept",
      3	.insns = {
      4	BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1, 0),
      5	BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
      6	BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
      7	BPF_MOV64_IMM(BPF_REG_6, 0),
      8	BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_6, 0),
      9	BPF_LD_IMM64(BPF_REG_3, 8),
     10	BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_d_path),
     11	BPF_MOV64_IMM(BPF_REG_0, 0),
     12	BPF_EXIT_INSN(),
     13	},
     14	.result = ACCEPT,
     15	.prog_type = BPF_PROG_TYPE_TRACING,
     16	.expected_attach_type = BPF_TRACE_FENTRY,
     17	.kfunc = "dentry_open",
     18},
     19{
     20	"d_path reject",
     21	.insns = {
     22	BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_1, 0),
     23	BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
     24	BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
     25	BPF_MOV64_IMM(BPF_REG_6, 0),
     26	BPF_STX_MEM(BPF_DW, BPF_REG_2, BPF_REG_6, 0),
     27	BPF_LD_IMM64(BPF_REG_3, 8),
     28	BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_d_path),
     29	BPF_MOV64_IMM(BPF_REG_0, 0),
     30	BPF_EXIT_INSN(),
     31	},
     32	.errstr = "helper call is not allowed in probe",
     33	.result = REJECT,
     34	.prog_type = BPF_PROG_TYPE_TRACING,
     35	.expected_attach_type = BPF_TRACE_FENTRY,
     36	.kfunc = "d_path",
     37},