Skip to content

Filter by ret value #50

Answered by SeeFlowerX
chouex asked this question in Q&A
Discussion options

You must be logged in to vote

就现有代码来说,不支持对ret做过滤,只能对入参做过滤

最简单的方法是直接修改代码实现

u64 ret = READ_KERN(regs->regs[0]);

比如这里的代码修改成下面这样就可以实现只记录返回值为-2的结果,不过sys_enter和sys_exit的数据是分开发送的,所以这样依然会包含全部的sys_enter数据

    // 读取返回值
    u64 ret = READ_KERN(regs->regs[0]);
    if (ret != 0xfffffffffffffffe) {
        return 0;
    }
    save_to_submit_buf(p.event, (void *) &ret, sizeof(ret), op_ctx->save_index);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chouex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants