Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf: Use OPTS_SET() macro in bpf_xdp_query() #6405

Closed

Commits on Feb 6, 2024

  1. adding ci files

    Kernel Patches Daemon committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    1734320 View commit details
    Browse the repository at this point in the history
  2. libbpf: Use OPTS_SET() macro in bpf_xdp_query()

    When the feature_flags and xdp_zc_max_segs fields were added to the libbpf
    bpf_xdp_query_opts, the code writing them did not use the OPTS_SET() macro.
    This causes libbpf to write to those fields unconditionally, which means
    that programs compiled against an older version of libbpf (with a smaller
    size of the bpf_xdp_query_opts struct) will have its stack corrupted by
    libbpf writing out of bounds.
    
    The patch adding the feature_flags field has an early bail out if the
    feature_flags field is not part of the opts struct (via the OPTS_HAS)
    macro, but the patch adding xdp_zc_max_segs does not. For consistency, this
    fix just changes the assignments to both fields to use the OPTS_SET()
    macro.
    
    Fixes: 13ce2da ("xsk: add new netlink attribute dedicated for ZC max frags")
    Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
    tohojo authored and Kernel Patches Daemon committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    7495403 View commit details
    Browse the repository at this point in the history