#ifndef BPF_I_H #define BPF_I_H #include #include #include #include "xmalloc.h" #include "bpf_insns.h" #include "bpf_ext.h" #include "config.h" extern void bpf_dump_op_table(void); extern void bpf_dump_all(struct sock_fprog *bpf); extern int __bpf_validate(const struct sock_fprog *bpf); extern uint32_t bpf_run_filter(const struct sock_fprog *bpf, uint8_t *packet, size_t plen); extern void bpf_attach_to_sock(int sock, struct sock_fprog *bpf); extern void bpf_detach_from_sock(int sock); extern int enable_kernel_bpf_jit_compiler(void); extern void bpf_parse_rules(char *rulefile, struct sock_fprog *bpf, uint32_t link_type); #if defined(HAVE_TCPDUMP_LIKE_FILTER) && defined(NEED_TCPDUMP_LIKE_FILTER) extern void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf, uint32_t link_type); #else static inline void bpf_try_compile(const char *rulefile, struct sock_fprog *bpf __maybe_unused, uint32_t link_type __maybe_unused) { panic("Cannot open file %s!\n", rulefile); } #endif static inline void bpf_release(struct sock_fprog *bpf) { free(bpf->filter); } #endif /* BPF_I_H */ ption value='nds-private-remove' selected='selected'>nds-private-remove net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-08-28 18:41:01 +0100
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-09-22 22:33:40 -0700
commitff918912e1b8ba4e743d1f0b06ced1d01969e17c (patch)
tree1f51a4ce7333bc82853abb4e007154cfac57c7dc
parentb3f5c7bc88bab134e9649e42d30be15e3775f00d (diff)
i40e: avoid potential null pointer dereference when assigning len
There is a sanitcy check for desc being null in the first line of function i40evf_debug_aq. However, before that, aq_desc is cast from desc, and aq_desc is being dereferenced on the assignment of len, so this could be a potential null pointer deference. Fix this by moving the initialization of len to the code block where len is being used and hence at this point we know it is OK to dereference aq_desc. Signed-off-by: Colin Ian King <colin.king@canonical.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>