History

bpf: Add the missing BPF_LINK_TYPE invocation for sockmap

There is an out-of-bounds read in bpf_link_show_fdinfo() for the sockmap link fd. Fix it by adding the missing BPF_LINK_TYPE invocation for sockmap link Also add comments for bpf_link_type to prevent missing updates in the future.

Hou Tao committed 2 years ago

Commit c2f80301 parent 9806f283 files · +7 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -1121,6 +1121,9 @@ enum bpf_attach_type { · 1120 unmodified lines
11211121
11221122 #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
11231123
1124+/* Add BPF_LINK_TYPE(type, name) in bpf_types.h to keep bpf_link_type_strs[]
1125+ * in sync with the definitions below.
1126+ */
11241127 enum bpf_link_type {
11251128 BPF_LINK_TYPE_UNSPEC = 0,
11261129 BPF_LINK_TYPE_RAW_TRACEPOINT = 1,