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

bpf: fix incorrect initialization of bpf_ctx_convert_map #266

Closed
wants to merge 2 commits into from

Commits on Nov 6, 2020

  1. adding ci files

    kernel-patches-bot committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    4f662bb View commit details
    Browse the repository at this point in the history
  2. bpf: fix incorrect initialization of bpf_ctx_convert_map

    gcc -Wextra points out that a field may get overridden in some
    configurations such as x86 allmodconfig, when the next index after the one
    that has been assigned last already had a value, in this case for index
    BPF_PROG_TYPE_SK_LOOKUP, which comes after BPF_PROG_TYPE_LSM in the list:
    
    kernel/bpf/btf.c:4225:2: warning: initialized field overwritten [-Woverride-init]
     4225 |  0, /* avoid empty array */
          |  ^
    kernel/bpf/btf.c:4225:2: note: (near initialization for 'bpf_ctx_convert_map[30]')
    
    Move the zero-initializer first instead. This avoids the warning since
    nothing else uses index 0, and the last element does not have to be zero.
    
    Fixes: e9ddbb7 ("bpf: Introduce SK_LOOKUP program type with a dedicated attach point")
    Fixes: 4c80c7b ("bpf: Fix build in minimal configurations, again")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    arndb authored and kernel-patches-bot committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    d62a1c5 View commit details
    Browse the repository at this point in the history