Set required flag in flag list

24 views
Skip to first unread message

paul.c...@gmail.com

unread,
Sep 1, 2023, 7:53:07 AM9/1/23
to syzkaller
Hello,

I'm trying to describe an extension of the bpf(2) syscall where there is a new union in a struct akin to the following.

    struct {
        union {
            __u32 relative_fd;
            __u32 relative_id;
        };
        __u32 flags;
    };

The union is interpreted as a BPF ID or an FD depending on whether the flag BPF_F_ID is set. That flag is however not the only possible value, so BPF_F_AFTER|BPF_F_ID for instance would be acceptable.

Is there any way I can make the description more specific to cover this, by having two descriptions for the struct with one where BPF_F_ID is always set? Something like:

    bpf_tcx [
        id bpf_tcx_id
        fd bpf_tcx_fd
    ]
    bpf_tcx_id {
        relative_id bpf_id
        flags       flags[bpf_attach_flags, int32, BPF_F_ID] # BPF_F_ID always set.
    }
    bpf_tcx_id {
        relative_fd bpf_fd
        flags       flags[bpf_attach_flags, int32]
    }

Thank you,
Paul

Aleksandr Nogikh

unread,
Sep 4, 2023, 8:39:22 AM9/4/23
to paul.c...@gmail.com, syzkaller
Hi Paul,

No, this is unfotunately not supported at the moment. I've filed an
issue: https://github.com/google/syzkaller/issues/4191

--
Aleksandr
Reply all
Reply to author
Forward
0 new messages