• Brenden Blanco's avatar
    Translate multiple pointer dereference into bpr_probe_read · 70fa0a1c
    Brenden Blanco authored
    This commit adds support for multiple consecutive and nested pointer
    dereference of function arguments that should be converted to
    bpf_probe_read. The logic works by marking variables as needing a
    probe_read if they come from the register argument, and then applying
    this property transitively.
    
    Supported syntax:
    ```
    int trace_entry(struct pt_regs *ctx, struct file *file) {
        struct vfsmount *mnt = file->f_path.mnt;
        struct super_block *k = mnt->mnt_sb;
        const char *name = file->f_path.dentry->d_name.name;
    ```
    
    Not supported: probe reads from map leaves, probe reads after explicit casts.
    
    Fixes: #188
    Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
    70fa0a1c
test_clang.py 4.38 KB