idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
43,200
static u8 __init acpi_table_checksum(u8 *buffer, u32 length) { u8 sum = 0; u8 *end = buffer + length; while (buffer < end) sum = (u8) (sum + *(buffer++)); return sum; }
Exec Code Bypass
0
static u8 __init acpi_table_checksum(u8 *buffer, u32 length) { u8 sum = 0; u8 *end = buffer + length; while (buffer < end) sum = (u8) (sum + *(buffer++)); return sum; }
@@ -707,6 +707,12 @@ void __init acpi_initrd_override(void *data, size_t size) if (table_nr == 0) return; + if (get_securelevel() > 0) { + pr_notice(PREFIX + "securelevel enabled, ignoring table override\n"); + return; + } + acpi_tables_addr = memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, ...
CWE-264
null
null
43,201
static void acpi_table_taint(struct acpi_table_header *table) { pr_warn(PREFIX "Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n", table->signature, table->oem_table_id); add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE); }
Exec Code Bypass
0
static void acpi_table_taint(struct acpi_table_header *table) { pr_warn(PREFIX "Override [%4.4s-%8.8s], this is unsafe: tainting kernel\n", table->signature, table->oem_table_id); add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE); }
@@ -707,6 +707,12 @@ void __init acpi_initrd_override(void *data, size_t size) if (table_nr == 0) return; + if (get_securelevel() > 0) { + pr_notice(PREFIX + "securelevel enabled, ignoring table override\n"); + return; + } + acpi_tables_addr = memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, ...
CWE-264
null
null
43,202
static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) { unsigned long pfn; pfn = pg_off >> PAGE_SHIFT; if (should_use_kmap(pfn)) kunmap(pfn_to_page(pfn)); else iounmap(vaddr); }
Exec Code Bypass
0
static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) { unsigned long pfn; pfn = pg_off >> PAGE_SHIFT; if (should_use_kmap(pfn)) kunmap(pfn_to_page(pfn)); else iounmap(vaddr); }
@@ -707,6 +707,12 @@ void __init acpi_initrd_override(void *data, size_t size) if (table_nr == 0) return; + if (get_securelevel() > 0) { + pr_notice(PREFIX + "securelevel enabled, ignoring table override\n"); + return; + } + acpi_tables_addr = memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, ...
CWE-264
null
null
43,203
void acpi_unregister_debugger(const struct acpi_debugger_ops *ops) { mutex_lock(&acpi_debugger.lock); if (ops == acpi_debugger.ops) { acpi_debugger.ops = NULL; acpi_debugger.owner = NULL; } mutex_unlock(&acpi_debugger.lock); }
Exec Code Bypass
0
void acpi_unregister_debugger(const struct acpi_debugger_ops *ops) { mutex_lock(&acpi_debugger.lock); if (ops == acpi_debugger.ops) { acpi_debugger.ops = NULL; acpi_debugger.owner = NULL; } mutex_unlock(&acpi_debugger.lock); }
@@ -707,6 +707,12 @@ void __init acpi_initrd_override(void *data, size_t size) if (table_nr == 0) return; + if (get_securelevel() > 0) { + pr_notice(PREFIX + "securelevel enabled, ignoring table override\n"); + return; + } + acpi_tables_addr = memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, ...
CWE-264
null
null
43,204
void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size) { if (!acpi_gbl_permanent_mmap) __acpi_unmap_table(virt, size); }
Exec Code Bypass
0
void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size) { if (!acpi_gbl_permanent_mmap) __acpi_unmap_table(virt, size); }
@@ -707,6 +707,12 @@ void __init acpi_initrd_override(void *data, size_t size) if (table_nr == 0) return; + if (get_securelevel() > 0) { + pr_notice(PREFIX + "securelevel enabled, ignoring table override\n"); + return; + } + acpi_tables_addr = memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, ...
CWE-264
null
null
43,205
static int log_priority(const char *priority) { char *endptr; int prio; prio = strtol(priority, &endptr, 10); if (endptr[0] == '\0' || isspace(endptr[0])) return prio; if (strncmp(priority, "err", 3) == 0) return LOG_ERR; if (strncmp(priority, "info", 4) == 0) return LOG_INFO; if (strncmp(priority, "debug...
DoS
0
static int log_priority(const char *priority) { char *endptr; int prio; prio = strtol(priority, &endptr, 10); if (endptr[0] == '\0' || isspace(endptr[0])) return prio; if (strncmp(priority, "err", 3) == 0) return LOG_ERR; if (strncmp(priority, "info", 4) == 0) return LOG_INFO; if (strncmp(priority, "debug...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,206
static void *myzalloc(size_t size) { return calloc(1, size); }
DoS
0
static void *myzalloc(size_t size) { return calloc(1, size); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,207
static int ndp_call_handlers(struct ndp *ndp, struct ndp_msg *msg) { struct ndp_msgrcv_handler_item *handler_item; int err; list_for_each_node_entry(handler_item, &ndp->msgrcv_handler_list, list) { if (handler_item->msg_type != NDP_MSG_ALL && handler_item->msg_type != ndp_msg_type(msg)) continue; ...
DoS
0
static int ndp_call_handlers(struct ndp *ndp, struct ndp_msg *msg) { struct ndp_msgrcv_handler_item *handler_item; int err; list_for_each_node_entry(handler_item, &ndp->msgrcv_handler_list, list) { if (handler_item->msg_type != NDP_MSG_ALL && handler_item->msg_type != ndp_msg_type(msg)) continue; ...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,208
int ndp_callall_eventfd_handler(struct ndp *ndp) { fd_set rfds; int fdmax; struct timeval tv; int fd = ndp_get_eventfd(ndp); int ret; int err; memset(&tv, 0, sizeof(tv)); FD_ZERO(&rfds); FD_SET(fd, &rfds); fdmax = fd + 1; while (true) { ret = select(fdmax, &rfds, NULL, NULL, &tv); if (ret == -1) retu...
DoS
0
int ndp_callall_eventfd_handler(struct ndp *ndp) { fd_set rfds; int fdmax; struct timeval tv; int fd = ndp_get_eventfd(ndp); int ret; int err; memset(&tv, 0, sizeof(tv)); FD_ZERO(&rfds); FD_SET(fd, &rfds); fdmax = fd + 1; while (true) { ret = select(fdmax, &rfds, NULL, NULL, &tv); if (ret == -1) retu...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,209
void ndp_close(struct ndp *ndp) { ndp_sock_close(ndp); free(ndp); }
DoS
0
void ndp_close(struct ndp *ndp) { ndp_sock_close(ndp); free(ndp); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,210
ndp_find_msgrcv_handler_item(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; list_for_each_node_entry(handler_item, &ndp->msgrcv_handler_list, list) if (handler_item->func == func && ...
DoS
0
ndp_find_msgrcv_handler_item(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; list_for_each_node_entry(handler_item, &ndp->msgrcv_handler_list, list) if (handler_item->func == func && ...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,211
int ndp_get_eventfd(struct ndp *ndp) { return ndp->sock; }
DoS
0
int ndp_get_eventfd(struct ndp *ndp) { return ndp->sock; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,212
int ndp_get_log_priority(struct ndp *ndp) { return ndp->log_priority; }
DoS
0
int ndp_get_log_priority(struct ndp *ndp) { return ndp->log_priority; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,213
static void ndp_msg_addrto_adjust_all_nodes(struct in6_addr *addr) { struct in6_addr any = IN6ADDR_ANY_INIT; if (memcmp(addr, &any, sizeof(any))) return; addr->s6_addr32[0] = htonl(0xFF020000); addr->s6_addr32[1] = 0; addr->s6_addr32[2] = 0; addr->s6_addr32[3] = htonl(0x1); }
DoS
0
static void ndp_msg_addrto_adjust_all_nodes(struct in6_addr *addr) { struct in6_addr any = IN6ADDR_ANY_INIT; if (memcmp(addr, &any, sizeof(any))) return; addr->s6_addr32[0] = htonl(0xFF020000); addr->s6_addr32[1] = 0; addr->s6_addr32[2] = 0; addr->s6_addr32[3] = htonl(0x1); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,214
static void ndp_msg_addrto_adjust_all_routers(struct in6_addr *addr) { struct in6_addr any = IN6ADDR_ANY_INIT; if (memcmp(addr, &any, sizeof(any))) return; addr->s6_addr32[0] = htonl(0xFF020000); addr->s6_addr32[1] = 0; addr->s6_addr32[2] = 0; addr->s6_addr32[3] = htonl(0x2); }
DoS
0
static void ndp_msg_addrto_adjust_all_routers(struct in6_addr *addr) { struct in6_addr any = IN6ADDR_ANY_INIT; if (memcmp(addr, &any, sizeof(any))) return; addr->s6_addr32[0] = htonl(0xFF020000); addr->s6_addr32[1] = 0; addr->s6_addr32[2] = 0; addr->s6_addr32[3] = htonl(0x2); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,215
static struct ndp_msg *ndp_msg_alloc(void) { struct ndp_msg *msg; msg = myzalloc(sizeof(*msg)); if (!msg) return NULL; msg->icmp6_hdr = (struct icmp6_hdr *) msg->buf; return msg; }
DoS
0
static struct ndp_msg *ndp_msg_alloc(void) { struct ndp_msg *msg; msg = myzalloc(sizeof(*msg)); if (!msg) return NULL; msg->icmp6_hdr = (struct icmp6_hdr *) msg->buf; return msg; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,216
void ndp_msg_destroy(struct ndp_msg *msg) { free(msg); }
DoS
0
void ndp_msg_destroy(struct ndp_msg *msg) { free(msg); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,217
uint32_t ndp_msg_ifindex(struct ndp_msg *msg) { return msg->ifindex; }
DoS
0
uint32_t ndp_msg_ifindex(struct ndp_msg *msg) { return msg->ifindex; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,218
void ndp_msg_ifindex_set(struct ndp_msg *msg, uint32_t ifindex) { msg->ifindex = ifindex; }
DoS
0
void ndp_msg_ifindex_set(struct ndp_msg *msg, uint32_t ifindex) { msg->ifindex = ifindex; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,219
static void ndp_msg_init(struct ndp_msg *msg, enum ndp_msg_type msg_type) { size_t raw_struct_size = ndp_msg_type_info(msg_type)->raw_struct_size; ndp_msg_type_set(msg, msg_type); msg->len = raw_struct_size; msg->opts_start = msg->buf + raw_struct_size; /* Set-up "first pointers" in all ndp_msgrs, ndp_msgra, ndp...
DoS
0
static void ndp_msg_init(struct ndp_msg *msg, enum ndp_msg_type msg_type) { size_t raw_struct_size = ndp_msg_type_info(msg_type)->raw_struct_size; ndp_msg_type_set(msg, msg_type); msg->len = raw_struct_size; msg->opts_start = msg->buf + raw_struct_size; /* Set-up "first pointers" in all ndp_msgrs, ndp_msgra, ndp...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,220
int ndp_msg_new(struct ndp_msg **p_msg, enum ndp_msg_type msg_type) { struct ndp_msg *msg; if (msg_type == NDP_MSG_ALL) return -EINVAL; msg = ndp_msg_alloc(); if (!msg) return -ENOMEM; ndp_msg_init(msg, msg_type); *p_msg = msg; return 0; }
DoS
0
int ndp_msg_new(struct ndp_msg **p_msg, enum ndp_msg_type msg_type) { struct ndp_msg *msg; if (msg_type == NDP_MSG_ALL) return -EINVAL; msg = ndp_msg_alloc(); if (!msg) return -ENOMEM; ndp_msg_init(msg, msg_type); *p_msg = msg; return 0; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,221
int ndp_msg_next_opt_offset(struct ndp_msg *msg, int offset, enum ndp_msg_opt_type opt_type) { unsigned char *opts_start = ndp_msg_payload_opts(msg); unsigned char *ptr = opts_start; size_t len = ndp_msg_payload_opts_len(msg); uint8_t opt_raw_type = ndp_msg_opt_type_info(opt_type)->raw_type; bool ignore = t...
DoS
0
int ndp_msg_next_opt_offset(struct ndp_msg *msg, int offset, enum ndp_msg_opt_type opt_type) { unsigned char *opts_start = ndp_msg_payload_opts(msg); unsigned char *ptr = opts_start; size_t len = ndp_msg_payload_opts_len(msg); uint8_t opt_raw_type = ndp_msg_opt_type_info(opt_type)->raw_type; bool ignore = t...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,222
char *ndp_msg_opt_dnssl_domain(struct ndp_msg *msg, int offset, int domain_index) { int i; static char buf[256]; struct __nd_opt_dnssl *dnssl = ndp_msg_payload_opts_offset(msg, offset); size_t len = dnssl->nd_opt_dnssl_len << 3; /* convert to bytes */ char *ptr; len -= in_struct_offset(struct __nd_o...
DoS
0
char *ndp_msg_opt_dnssl_domain(struct ndp_msg *msg, int offset, int domain_index) { int i; static char buf[256]; struct __nd_opt_dnssl *dnssl = ndp_msg_payload_opts_offset(msg, offset); size_t len = dnssl->nd_opt_dnssl_len << 3; /* convert to bytes */ char *ptr; len -= in_struct_offset(struct __nd_o...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,223
uint32_t ndp_msg_opt_dnssl_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_dnssl *dnssl = ndp_msg_payload_opts_offset(msg, offset); return ntohl(dnssl->nd_opt_dnssl_lifetime); }
DoS
0
uint32_t ndp_msg_opt_dnssl_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_dnssl *dnssl = ndp_msg_payload_opts_offset(msg, offset); return ntohl(dnssl->nd_opt_dnssl_lifetime); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,224
uint32_t ndp_msg_opt_mtu(struct ndp_msg *msg, int offset) { struct nd_opt_mtu *mtu = ndp_msg_payload_opts_offset(msg, offset); return ntohl(mtu->nd_opt_mtu_mtu); }
DoS
0
uint32_t ndp_msg_opt_mtu(struct ndp_msg *msg, int offset) { struct nd_opt_mtu *mtu = ndp_msg_payload_opts_offset(msg, offset); return ntohl(mtu->nd_opt_mtu_mtu); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,225
struct in6_addr *ndp_msg_opt_prefix(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return &pi->nd_opt_pi_prefix; }
DoS
0
struct in6_addr *ndp_msg_opt_prefix(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return &pi->nd_opt_pi_prefix; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,226
bool ndp_msg_opt_prefix_flag_auto_addr_conf(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO; }
DoS
0
bool ndp_msg_opt_prefix_flag_auto_addr_conf(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,227
bool ndp_msg_opt_prefix_flag_on_link(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK; }
DoS
0
bool ndp_msg_opt_prefix_flag_on_link(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,228
uint8_t ndp_msg_opt_prefix_len(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_prefix_len; }
DoS
0
uint8_t ndp_msg_opt_prefix_len(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return pi->nd_opt_pi_prefix_len; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,229
uint32_t ndp_msg_opt_prefix_preferred_time(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return ntohl(pi->nd_opt_pi_preferred_time); }
DoS
0
uint32_t ndp_msg_opt_prefix_preferred_time(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return ntohl(pi->nd_opt_pi_preferred_time); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,230
uint32_t ndp_msg_opt_prefix_valid_time(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return ntohl(pi->nd_opt_pi_valid_time); }
DoS
0
uint32_t ndp_msg_opt_prefix_valid_time(struct ndp_msg *msg, int offset) { struct nd_opt_prefix_info *pi = ndp_msg_payload_opts_offset(msg, offset); return ntohl(pi->nd_opt_pi_valid_time); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,231
uint32_t ndp_msg_opt_rdnss_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_rdnss *rdnss = ndp_msg_payload_opts_offset(msg, offset); return ntohl(rdnss->nd_opt_rdnss_lifetime); }
DoS
0
uint32_t ndp_msg_opt_rdnss_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_rdnss *rdnss = ndp_msg_payload_opts_offset(msg, offset); return ntohl(rdnss->nd_opt_rdnss_lifetime); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,232
static bool ndp_msg_opt_route_check_valid(void *opt_data) { struct __nd_opt_route_info *ri = opt_data; /* rfc4191 says: * If the Reserved (10) value is received, the Route Information Option * MUST be ignored. */ if (((ri->nd_opt_ri_prf_reserved >> 3) & 3) == 2) return false; return true; }
DoS
0
static bool ndp_msg_opt_route_check_valid(void *opt_data) { struct __nd_opt_route_info *ri = opt_data; /* rfc4191 says: * If the Reserved (10) value is received, the Route Information Option * MUST be ignored. */ if (((ri->nd_opt_ri_prf_reserved >> 3) & 3) == 2) return false; return true; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,233
uint32_t ndp_msg_opt_route_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); return ntohl(ri->nd_opt_ri_lifetime); }
DoS
0
uint32_t ndp_msg_opt_route_lifetime(struct ndp_msg *msg, int offset) { struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); return ntohl(ri->nd_opt_ri_lifetime); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,234
ndp_msg_opt_route_preference(struct ndp_msg *msg, int offset) { struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); return (ri->nd_opt_ri_prf_reserved >> 3) & 3; }
DoS
0
ndp_msg_opt_route_preference(struct ndp_msg *msg, int offset) { struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); return (ri->nd_opt_ri_prf_reserved >> 3) & 3; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,235
struct in6_addr *ndp_msg_opt_route_prefix(struct ndp_msg *msg, int offset) { static struct in6_addr prefix; struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); memset(&prefix, 0, sizeof(prefix)); memcpy(&prefix, &ri->nd_opt_ri_prefix, (ri->nd_opt_ri_len - 1) << 3); return &prefix; }
DoS
0
struct in6_addr *ndp_msg_opt_route_prefix(struct ndp_msg *msg, int offset) { static struct in6_addr prefix; struct __nd_opt_route_info *ri = ndp_msg_payload_opts_offset(msg, offset); memset(&prefix, 0, sizeof(prefix)); memcpy(&prefix, &ri->nd_opt_ri_prefix, (ri->nd_opt_ri_len - 1) << 3); return &prefix; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,236
unsigned char *ndp_msg_opt_slladdr(struct ndp_msg *msg, int offset) { unsigned char *opt_data = ndp_msg_payload_opts_offset(msg, offset); return &opt_data[2]; }
DoS
0
unsigned char *ndp_msg_opt_slladdr(struct ndp_msg *msg, int offset) { unsigned char *opt_data = ndp_msg_payload_opts_offset(msg, offset); return &opt_data[2]; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,237
size_t ndp_msg_opt_slladdr_len(struct ndp_msg *msg, int offset) { return ETH_ALEN; }
DoS
0
size_t ndp_msg_opt_slladdr_len(struct ndp_msg *msg, int offset) { return ETH_ALEN; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,238
unsigned char *ndp_msg_opt_tlladdr(struct ndp_msg *msg, int offset) { unsigned char *opt_data = ndp_msg_payload_opts_offset(msg, offset); return &opt_data[2]; }
DoS
0
unsigned char *ndp_msg_opt_tlladdr(struct ndp_msg *msg, int offset) { unsigned char *opt_data = ndp_msg_payload_opts_offset(msg, offset); return &opt_data[2]; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,239
struct ndp_msg_opt_type_info *ndp_msg_opt_type_info(enum ndp_msg_opt_type msg_opt_type) { return &ndp_msg_opt_type_info_list[msg_opt_type]; }
DoS
0
struct ndp_msg_opt_type_info *ndp_msg_opt_type_info(enum ndp_msg_opt_type msg_opt_type) { return &ndp_msg_opt_type_info_list[msg_opt_type]; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,240
struct ndp_msg_opt_type_info *ndp_msg_opt_type_info_by_raw_type(uint8_t raw_type) { struct ndp_msg_opt_type_info *info; int i; for (i = 0; i < NDP_MSG_OPT_TYPE_LIST_SIZE; i++) { info = &ndp_msg_opt_type_info_list[i]; if (info->raw_type == raw_type) return info; } return NULL; }
DoS
0
struct ndp_msg_opt_type_info *ndp_msg_opt_type_info_by_raw_type(uint8_t raw_type) { struct ndp_msg_opt_type_info *info; int i; for (i = 0; i < NDP_MSG_OPT_TYPE_LIST_SIZE; i++) { info = &ndp_msg_opt_type_info_list[i]; if (info->raw_type == raw_type) return info; } return NULL; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,241
size_t ndp_msg_payload_len(struct ndp_msg *msg) { return msg->len; }
DoS
0
size_t ndp_msg_payload_len(struct ndp_msg *msg) { return msg->len; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,242
void ndp_msg_payload_len_set(struct ndp_msg *msg, size_t len) { if (len > sizeof(msg->buf)) len = sizeof(msg->buf); msg->len = len; }
DoS
0
void ndp_msg_payload_len_set(struct ndp_msg *msg, size_t len) { if (len > sizeof(msg->buf)) len = sizeof(msg->buf); msg->len = len; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,243
void *ndp_msg_payload_opts(struct ndp_msg *msg) { return msg->opts_start; }
DoS
0
void *ndp_msg_payload_opts(struct ndp_msg *msg) { return msg->opts_start; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,244
size_t ndp_msg_payload_opts_len(struct ndp_msg *msg) { return msg->len - (msg->opts_start - msg->buf); }
DoS
0
size_t ndp_msg_payload_opts_len(struct ndp_msg *msg) { return msg->len - (msg->opts_start - msg->buf); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,245
static void *ndp_msg_payload_opts_offset(struct ndp_msg *msg, int offset) { unsigned char *ptr = ndp_msg_payload_opts(msg); return ptr + offset; }
DoS
0
static void *ndp_msg_payload_opts_offset(struct ndp_msg *msg, int offset) { unsigned char *ptr = ndp_msg_payload_opts(msg); return ptr + offset; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,246
static int ndp_msg_type_by_raw_type(enum ndp_msg_type *p_msg_type, uint8_t raw_type) { int i; for (i = 0; i < NDP_MSG_TYPE_LIST_SIZE; i++) { if (ndp_msg_type_info(i)->raw_type == raw_type) { *p_msg_type = i; return 0; } } return -ENOENT; }
DoS
0
static int ndp_msg_type_by_raw_type(enum ndp_msg_type *p_msg_type, uint8_t raw_type) { int i; for (i = 0; i < NDP_MSG_TYPE_LIST_SIZE; i++) { if (ndp_msg_type_info(i)->raw_type == raw_type) { *p_msg_type = i; return 0; } } return -ENOENT; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,247
bool ndp_msgna_flag_override(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_OVERRIDE; }
DoS
0
bool ndp_msgna_flag_override(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_OVERRIDE; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,248
void ndp_msgna_flag_override_set(struct ndp_msgna *msgna, bool flag_override) { if (flag_override) msgna->na->nd_na_flags_reserved |= ND_NA_FLAG_OVERRIDE; else msgna->na->nd_na_flags_reserved &= ~ND_NA_FLAG_OVERRIDE; }
DoS
0
void ndp_msgna_flag_override_set(struct ndp_msgna *msgna, bool flag_override) { if (flag_override) msgna->na->nd_na_flags_reserved |= ND_NA_FLAG_OVERRIDE; else msgna->na->nd_na_flags_reserved &= ~ND_NA_FLAG_OVERRIDE; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,249
bool ndp_msgna_flag_router(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_ROUTER; }
DoS
0
bool ndp_msgna_flag_router(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_ROUTER; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,250
bool ndp_msgna_flag_solicited(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_SOLICITED; }
DoS
0
bool ndp_msgna_flag_solicited(struct ndp_msgna *msgna) { return msgna->na->nd_na_flags_reserved & ND_NA_FLAG_SOLICITED; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,251
void ndp_msgna_flag_solicited_set(struct ndp_msgna *msgna, bool flag_solicited) { if (flag_solicited) msgna->na->nd_na_flags_reserved |= ND_NA_FLAG_SOLICITED; else msgna->na->nd_na_flags_reserved &= ~ND_NA_FLAG_SOLICITED; }
DoS
0
void ndp_msgna_flag_solicited_set(struct ndp_msgna *msgna, bool flag_solicited) { if (flag_solicited) msgna->na->nd_na_flags_reserved |= ND_NA_FLAG_SOLICITED; else msgna->na->nd_na_flags_reserved &= ~ND_NA_FLAG_SOLICITED; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,252
struct ndp_msgns *ndp_msgns(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_NS) return NULL; return &msg->nd_msg.ns; }
DoS
0
struct ndp_msgns *ndp_msgns(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_NS) return NULL; return &msg->nd_msg.ns; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,253
struct ndp_msgr *ndp_msgr(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_R) return NULL; return &msg->nd_msg.r; }
DoS
0
struct ndp_msgr *ndp_msgr(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_R) return NULL; return &msg->nd_msg.r; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,254
struct ndp_msgra *ndp_msgra(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_RA) return NULL; return &msg->nd_msg.ra; }
DoS
0
struct ndp_msgra *ndp_msgra(struct ndp_msg *msg) { if (ndp_msg_type(msg) != NDP_MSG_RA) return NULL; return &msg->nd_msg.ra; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,255
uint8_t ndp_msgra_curhoplimit(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_curhoplimit; }
DoS
0
uint8_t ndp_msgra_curhoplimit(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_curhoplimit; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,256
void ndp_msgra_curhoplimit_set(struct ndp_msgra *msgra, uint8_t curhoplimit) { msgra->ra->nd_ra_curhoplimit = curhoplimit; }
DoS
0
void ndp_msgra_curhoplimit_set(struct ndp_msgra *msgra, uint8_t curhoplimit) { msgra->ra->nd_ra_curhoplimit = curhoplimit; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,257
bool ndp_msgra_flag_managed(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED; }
DoS
0
bool ndp_msgra_flag_managed(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,258
void ndp_msgra_flag_managed_set(struct ndp_msgra *msgra, bool flag_managed) { if (flag_managed) msgra->ra->nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED; else msgra->ra->nd_ra_flags_reserved &= ~ND_RA_FLAG_MANAGED; }
DoS
0
void ndp_msgra_flag_managed_set(struct ndp_msgra *msgra, bool flag_managed) { if (flag_managed) msgra->ra->nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED; else msgra->ra->nd_ra_flags_reserved &= ~ND_RA_FLAG_MANAGED; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,259
bool ndp_msgra_flag_other(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER; }
DoS
0
bool ndp_msgra_flag_other(struct ndp_msgra *msgra) { return msgra->ra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,260
void ndp_msgra_flag_other_set(struct ndp_msgra *msgra, bool flag_other) { if (flag_other) msgra->ra->nd_ra_flags_reserved |= ND_RA_FLAG_OTHER; else msgra->ra->nd_ra_flags_reserved &= ~ND_RA_FLAG_OTHER; }
DoS
0
void ndp_msgra_flag_other_set(struct ndp_msgra *msgra, bool flag_other) { if (flag_other) msgra->ra->nd_ra_flags_reserved |= ND_RA_FLAG_OTHER; else msgra->ra->nd_ra_flags_reserved &= ~ND_RA_FLAG_OTHER; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,261
uint32_t ndp_msgra_reachable_time(struct ndp_msgra *msgra) { return ntohl(msgra->ra->nd_ra_reachable); }
DoS
0
uint32_t ndp_msgra_reachable_time(struct ndp_msgra *msgra) { return ntohl(msgra->ra->nd_ra_reachable); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,262
void ndp_msgra_reachable_time_set(struct ndp_msgra *msgra, uint32_t reachable_time) { msgra->ra->nd_ra_reachable = htonl(reachable_time); }
DoS
0
void ndp_msgra_reachable_time_set(struct ndp_msgra *msgra, uint32_t reachable_time) { msgra->ra->nd_ra_reachable = htonl(reachable_time); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,263
void ndp_msgra_retransmit_time_set(struct ndp_msgra *msgra, uint32_t retransmit_time) { msgra->ra->nd_ra_retransmit = htonl(retransmit_time); }
DoS
0
void ndp_msgra_retransmit_time_set(struct ndp_msgra *msgra, uint32_t retransmit_time) { msgra->ra->nd_ra_retransmit = htonl(retransmit_time); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,264
enum ndp_route_preference ndp_msgra_route_preference(struct ndp_msgra *msgra) { uint8_t prf = (msgra->ra->nd_ra_flags_reserved >> 3) & 3; /* rfc4191 says: * If the Router Lifetime is zero, the preference value MUST be set to * (00) by the sender and MUST be ignored by the receiver. * If the Reserved (10) value...
DoS
0
enum ndp_route_preference ndp_msgra_route_preference(struct ndp_msgra *msgra) { uint8_t prf = (msgra->ra->nd_ra_flags_reserved >> 3) & 3; /* rfc4191 says: * If the Router Lifetime is zero, the preference value MUST be set to * (00) by the sender and MUST be ignored by the receiver. * If the Reserved (10) value...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,265
uint16_t ndp_msgra_router_lifetime(struct ndp_msgra *msgra) { return ntohs(msgra->ra->nd_ra_router_lifetime); }
DoS
0
uint16_t ndp_msgra_router_lifetime(struct ndp_msgra *msgra) { return ntohs(msgra->ra->nd_ra_router_lifetime); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,266
void ndp_msgra_router_lifetime_set(struct ndp_msgra *msgra, uint16_t router_lifetime) { msgra->ra->nd_ra_router_lifetime = htons(router_lifetime); }
DoS
0
void ndp_msgra_router_lifetime_set(struct ndp_msgra *msgra, uint16_t router_lifetime) { msgra->ra->nd_ra_router_lifetime = htons(router_lifetime); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,267
int ndp_msgrcv_handler_register(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; if (ndp_find_msgrcv_handler_item(ndp, func, msg_type, ifindex, priv)) return -EEXIST; if (!func) return -EINVAL...
DoS
0
int ndp_msgrcv_handler_register(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; if (ndp_find_msgrcv_handler_item(ndp, func, msg_type, ifindex, priv)) return -EEXIST; if (!func) return -EINVAL...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,268
void ndp_msgrcv_handler_unregister(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; handler_item = ndp_find_msgrcv_handler_item(ndp, func, msg_type, ifindex, priv); if (!handler_item) ...
DoS
0
void ndp_msgrcv_handler_unregister(struct ndp *ndp, ndp_msgrcv_handler_func_t func, enum ndp_msg_type msg_type, uint32_t ifindex, void *priv) { struct ndp_msgrcv_handler_item *handler_item; handler_item = ndp_find_msgrcv_handler_item(ndp, func, msg_type, ifindex, priv); if (!handler_item) ...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,269
int ndp_open(struct ndp **p_ndp) { struct ndp *ndp; const char *env; int err; ndp = myzalloc(sizeof(*ndp)); if (!ndp) return -ENOMEM; ndp->log_fn = log_stderr; ndp->log_priority = LOG_ERR; /* environment overwrites config */ env = getenv("NDP_LOG"); if (env != NULL) ndp_set_log_priority(ndp, log_priority...
DoS
0
int ndp_open(struct ndp **p_ndp) { struct ndp *ndp; const char *env; int err; ndp = myzalloc(sizeof(*ndp)); if (!ndp) return -ENOMEM; ndp->log_fn = log_stderr; ndp->log_priority = LOG_ERR; /* environment overwrites config */ env = getenv("NDP_LOG"); if (env != NULL) ndp_set_log_priority(ndp, log_priority...
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,270
void ndp_set_log_fn(struct ndp *ndp, void (*log_fn)(struct ndp *ndp, int priority, const char *file, int line, const char *fn, const char *format, va_list args)) { ndp->log_fn = log_fn; dbg(ndp, "Custom logging function %p registered.", log_fn); }
DoS
0
void ndp_set_log_fn(struct ndp *ndp, void (*log_fn)(struct ndp *ndp, int priority, const char *file, int line, const char *fn, const char *format, va_list args)) { ndp->log_fn = log_fn; dbg(ndp, "Custom logging function %p registered.", log_fn); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,271
void ndp_set_log_priority(struct ndp *ndp, int priority) { ndp->log_priority = priority; }
DoS
0
void ndp_set_log_priority(struct ndp *ndp, int priority) { ndp->log_priority = priority; }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,272
static void ndp_sock_close(struct ndp *ndp) { close(ndp->sock); }
DoS
0
static void ndp_sock_close(struct ndp *ndp) { close(ndp->sock); }
@@ -137,10 +137,10 @@ static void *myzalloc(size_t size) } static int myrecvfrom6(int sockfd, void *buf, size_t *buflen, int flags, - struct in6_addr *addr, uint32_t *ifindex) + struct in6_addr *addr, uint32_t *ifindex, int *hoplimit) { struct sockaddr_in6 sin6; - unsigned char cbuf[CMSG_SPACE(si...
CWE-284
null
null
43,273
static int __ims_pcu_execute_bl_command(struct ims_pcu *pcu, u8 command, const void *data, size_t len, u8 expected_response, int response_time) { int error; pcu->cmd_buf[0] = command; if (data) memcpy(&pcu->cmd_buf[1], data, len); error = __ims_pcu_execute_command(pcu, IMS_PCU_CMD_BO...
DoS
0
static int __ims_pcu_execute_bl_command(struct ims_pcu *pcu, u8 command, const void *data, size_t len, u8 expected_response, int response_time) { int error; pcu->cmd_buf[0] = command; if (data) memcpy(&pcu->cmd_buf[1], data, len); error = __ims_pcu_execute_command(pcu, IMS_PCU_CMD_BO...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,274
static int __ims_pcu_execute_command(struct ims_pcu *pcu, u8 command, const void *data, size_t len, u8 expected_response, int response_time) { int error; pcu->expected_response = expected_response; init_completion(&pcu->cmd_done); error = ims_pcu_send_command(pcu, command, data, len); if (error...
DoS
0
static int __ims_pcu_execute_command(struct ims_pcu *pcu, u8 command, const void *data, size_t len, u8 expected_response, int response_time) { int error; pcu->expected_response = expected_response; init_completion(&pcu->cmd_done); error = ims_pcu_send_command(pcu, command, data, len); if (error...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,275
static ssize_t ims_pcu_attribute_show(struct device *dev, struct device_attribute *dattr, char *buf) { struct usb_interface *intf = to_usb_interface(dev); struct ims_pcu *pcu = usb_get_intfdata(intf); struct ims_pcu_attribute *attr = container_of(dattr, struct ims_pcu_attribute, dattr); char ...
DoS
0
static ssize_t ims_pcu_attribute_show(struct device *dev, struct device_attribute *dattr, char *buf) { struct usb_interface *intf = to_usb_interface(dev); struct ims_pcu *pcu = usb_get_intfdata(intf); struct ims_pcu_attribute *attr = container_of(dattr, struct ims_pcu_attribute, dattr); char ...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,276
ims_pcu_backlight_get_brightness(struct led_classdev *cdev) { struct ims_pcu_backlight *backlight = container_of(cdev, struct ims_pcu_backlight, cdev); struct ims_pcu *pcu = container_of(backlight, struct ims_pcu, backlight); int brightness; int error; mutex_lock(&pcu->cmd_mutex); error = ims_pcu_execute_...
DoS
0
ims_pcu_backlight_get_brightness(struct led_classdev *cdev) { struct ims_pcu_backlight *backlight = container_of(cdev, struct ims_pcu_backlight, cdev); struct ims_pcu *pcu = container_of(backlight, struct ims_pcu, backlight); int brightness; int error; mutex_lock(&pcu->cmd_mutex); error = ims_pcu_execute_...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,277
static void ims_pcu_backlight_set_brightness(struct led_classdev *cdev, enum led_brightness value) { struct ims_pcu_backlight *backlight = container_of(cdev, struct ims_pcu_backlight, cdev); backlight->desired_brightness = value; schedule_work(&backlight->work); }
DoS
0
static void ims_pcu_backlight_set_brightness(struct led_classdev *cdev, enum led_brightness value) { struct ims_pcu_backlight *backlight = container_of(cdev, struct ims_pcu_backlight, cdev); backlight->desired_brightness = value; schedule_work(&backlight->work); }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,278
static void ims_pcu_backlight_work(struct work_struct *work) { struct ims_pcu_backlight *backlight = container_of(work, struct ims_pcu_backlight, work); struct ims_pcu *pcu = container_of(backlight, struct ims_pcu, backlight); int desired_brightness = backlight->desired_brightness; __le16 br_val = cpu_to_le16...
DoS
0
static void ims_pcu_backlight_work(struct work_struct *work) { struct ims_pcu_backlight *backlight = container_of(work, struct ims_pcu_backlight, work); struct ims_pcu *pcu = container_of(backlight, struct ims_pcu, backlight); int desired_brightness = backlight->desired_brightness; __le16 br_val = cpu_to_le16...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,279
static int ims_pcu_buffers_alloc(struct ims_pcu *pcu) { int error; pcu->urb_in_buf = usb_alloc_coherent(pcu->udev, pcu->max_in_size, GFP_KERNEL, &pcu->read_dma); if (!pcu->urb_in_buf) { dev_err(pcu->dev, "Failed to allocate memory for read buffer\n"); return -ENOMEM; } pcu->urb_in = usb_alloc_ur...
DoS
0
static int ims_pcu_buffers_alloc(struct ims_pcu *pcu) { int error; pcu->urb_in_buf = usb_alloc_coherent(pcu->udev, pcu->max_in_size, GFP_KERNEL, &pcu->read_dma); if (!pcu->urb_in_buf) { dev_err(pcu->dev, "Failed to allocate memory for read buffer\n"); return -ENOMEM; } pcu->urb_in = usb_alloc_ur...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,280
static void ims_pcu_buffers_free(struct ims_pcu *pcu) { usb_kill_urb(pcu->urb_in); usb_free_urb(pcu->urb_in); usb_free_coherent(pcu->udev, pcu->max_out_size, pcu->urb_in_buf, pcu->read_dma); kfree(pcu->urb_out_buf); usb_kill_urb(pcu->urb_ctrl); usb_free_urb(pcu->urb_ctrl); usb_free_coherent(pcu->udev, p...
DoS
0
static void ims_pcu_buffers_free(struct ims_pcu *pcu) { usb_kill_urb(pcu->urb_in); usb_free_urb(pcu->urb_in); usb_free_coherent(pcu->udev, pcu->max_out_size, pcu->urb_in_buf, pcu->read_dma); kfree(pcu->urb_out_buf); usb_kill_urb(pcu->urb_ctrl); usb_free_urb(pcu->urb_ctrl); usb_free_coherent(pcu->udev, p...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,281
static void ims_pcu_buttons_report(struct ims_pcu *pcu, u32 data) { struct ims_pcu_buttons *buttons = &pcu->buttons; struct input_dev *input = buttons->input; int i; for (i = 0; i < 32; i++) { unsigned short keycode = buttons->keymap[i]; if (keycode != KEY_RESERVED) input_report_key(input, keycode, data & ...
DoS
0
static void ims_pcu_buttons_report(struct ims_pcu *pcu, u32 data) { struct ims_pcu_buttons *buttons = &pcu->buttons; struct input_dev *input = buttons->input; int i; for (i = 0; i < 32; i++) { unsigned short keycode = buttons->keymap[i]; if (keycode != KEY_RESERVED) input_report_key(input, keycode, data & ...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,282
static unsigned int ims_pcu_count_fw_records(const struct firmware *fw) { const struct ihex_binrec *rec = (const struct ihex_binrec *)fw->data; unsigned int count = 0; while (rec) { count++; rec = ihex_next_binrec(rec); } return count; }
DoS
0
static unsigned int ims_pcu_count_fw_records(const struct firmware *fw) { const struct ihex_binrec *rec = (const struct ihex_binrec *)fw->data; unsigned int count = 0; while (rec) { count++; rec = ihex_next_binrec(rec); } return count; }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,283
static void ims_pcu_destroy_application_mode(struct ims_pcu *pcu) { if (pcu->setup_complete) { pcu->setup_complete = false; mb(); /* make sure flag setting is not reordered */ if (pcu->gamepad) ims_pcu_destroy_gamepad(pcu); ims_pcu_destroy_buttons(pcu); ims_pcu_destroy_backlight(pcu); if (pcu->device_...
DoS
0
static void ims_pcu_destroy_application_mode(struct ims_pcu *pcu) { if (pcu->setup_complete) { pcu->setup_complete = false; mb(); /* make sure flag setting is not reordered */ if (pcu->gamepad) ims_pcu_destroy_gamepad(pcu); ims_pcu_destroy_buttons(pcu); ims_pcu_destroy_backlight(pcu); if (pcu->device_...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,284
static void ims_pcu_destroy_backlight(struct ims_pcu *pcu) { struct ims_pcu_backlight *backlight = &pcu->backlight; led_classdev_unregister(&backlight->cdev); cancel_work_sync(&backlight->work); }
DoS
0
static void ims_pcu_destroy_backlight(struct ims_pcu *pcu) { struct ims_pcu_backlight *backlight = &pcu->backlight; led_classdev_unregister(&backlight->cdev); cancel_work_sync(&backlight->work); }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,285
static void ims_pcu_destroy_bootloader_mode(struct ims_pcu *pcu) { /* Make sure our initial firmware request has completed */ wait_for_completion(&pcu->async_firmware_done); }
DoS
0
static void ims_pcu_destroy_bootloader_mode(struct ims_pcu *pcu) { /* Make sure our initial firmware request has completed */ wait_for_completion(&pcu->async_firmware_done); }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,286
static void ims_pcu_destroy_buttons(struct ims_pcu *pcu) { struct ims_pcu_buttons *buttons = &pcu->buttons; input_unregister_device(buttons->input); }
DoS
0
static void ims_pcu_destroy_buttons(struct ims_pcu *pcu) { struct ims_pcu_buttons *buttons = &pcu->buttons; input_unregister_device(buttons->input); }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,287
static void ims_pcu_destroy_gamepad(struct ims_pcu *pcu) { struct ims_pcu_gamepad *gamepad = pcu->gamepad; input_unregister_device(gamepad->input); kfree(gamepad); }
DoS
0
static void ims_pcu_destroy_gamepad(struct ims_pcu *pcu) { struct ims_pcu_gamepad *gamepad = pcu->gamepad; input_unregister_device(gamepad->input); kfree(gamepad); }
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,288
static void ims_pcu_disconnect(struct usb_interface *intf) { struct ims_pcu *pcu = usb_get_intfdata(intf); struct usb_host_interface *alt = intf->cur_altsetting; usb_set_intfdata(intf, NULL); /* * See if we are dealing with control or data interface. The cleanup * happens when we unbind primary (control) inte...
DoS
0
static void ims_pcu_disconnect(struct usb_interface *intf) { struct ims_pcu *pcu = usb_get_intfdata(intf); struct usb_host_interface *alt = intf->cur_altsetting; usb_set_intfdata(intf, NULL); /* * See if we are dealing with control or data interface. The cleanup * happens when we unbind primary (control) inte...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,289
static int ims_pcu_flash_firmware(struct ims_pcu *pcu, const struct firmware *fw, unsigned int n_fw_records) { const struct ihex_binrec *rec = (const struct ihex_binrec *)fw->data; struct ims_pcu_flash_fmt *fragment; unsigned int count = 0; u32 addr; u8 len; int error; error = ims_pcu_execute_bl_com...
DoS
0
static int ims_pcu_flash_firmware(struct ims_pcu *pcu, const struct firmware *fw, unsigned int n_fw_records) { const struct ihex_binrec *rec = (const struct ihex_binrec *)fw->data; struct ims_pcu_flash_fmt *fragment; unsigned int count = 0; u32 addr; u8 len; int error; error = ims_pcu_execute_bl_com...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,290
ims_pcu_get_cdc_union_desc(struct usb_interface *intf) { const void *buf = intf->altsetting->extra; size_t buflen = intf->altsetting->extralen; struct usb_cdc_union_desc *union_desc; if (!buf) { dev_err(&intf->dev, "Missing descriptor data\n"); return NULL; } if (!buflen) { dev_err(&intf->dev, "Zero lengt...
DoS
0
ims_pcu_get_cdc_union_desc(struct usb_interface *intf) { const void *buf = intf->altsetting->extra; size_t buflen = intf->altsetting->extralen; struct usb_cdc_union_desc *union_desc; if (!buf) { dev_err(&intf->dev, "Missing descriptor data\n"); return NULL; } if (!buflen) { dev_err(&intf->dev, "Zero lengt...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,291
static int ims_pcu_get_device_info(struct ims_pcu *pcu) { int error; error = ims_pcu_get_info(pcu); if (error) return error; error = ims_pcu_execute_query(pcu, GET_FW_VERSION); if (error) { dev_err(pcu->dev, "GET_FW_VERSION command failed, error: %d\n", error); return error; } snprintf(pcu->fw_versio...
DoS
0
static int ims_pcu_get_device_info(struct ims_pcu *pcu) { int error; error = ims_pcu_get_info(pcu); if (error) return error; error = ims_pcu_execute_query(pcu, GET_FW_VERSION); if (error) { dev_err(pcu->dev, "GET_FW_VERSION command failed, error: %d\n", error); return error; } snprintf(pcu->fw_versio...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,292
static int ims_pcu_get_info(struct ims_pcu *pcu) { int error; error = ims_pcu_execute_query(pcu, GET_INFO); if (error) { dev_err(pcu->dev, "GET_INFO command failed, error: %d\n", error); return error; } memcpy(pcu->part_number, &pcu->cmd_buf[IMS_PCU_INFO_PART_OFFSET], sizeof(pcu->part_numb...
DoS
0
static int ims_pcu_get_info(struct ims_pcu *pcu) { int error; error = ims_pcu_execute_query(pcu, GET_INFO); if (error) { dev_err(pcu->dev, "GET_INFO command failed, error: %d\n", error); return error; } memcpy(pcu->part_number, &pcu->cmd_buf[IMS_PCU_INFO_PART_OFFSET], sizeof(pcu->part_numb...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,293
static int ims_pcu_handle_firmware_update(struct ims_pcu *pcu, const struct firmware *fw) { unsigned int n_fw_records; int retval; dev_info(pcu->dev, "Updating firmware %s, size: %zu\n", IMS_PCU_FIRMWARE_NAME, fw->size); n_fw_records = ims_pcu_count_fw_records(fw); retval = ims_pcu_flash_firmware(pcu,...
DoS
0
static int ims_pcu_handle_firmware_update(struct ims_pcu *pcu, const struct firmware *fw) { unsigned int n_fw_records; int retval; dev_info(pcu->dev, "Updating firmware %s, size: %zu\n", IMS_PCU_FIRMWARE_NAME, fw->size); n_fw_records = ims_pcu_count_fw_records(fw); retval = ims_pcu_flash_firmware(pcu,...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,294
static void ims_pcu_handle_response(struct ims_pcu *pcu) { switch (pcu->read_buf[0]) { case IMS_PCU_RSP_EVNT_BUTTONS: if (likely(pcu->setup_complete)) ims_pcu_report_events(pcu); break; default: /* * See if we got command completion. * If both the sequence and response code match save * the data a...
DoS
0
static void ims_pcu_handle_response(struct ims_pcu *pcu) { switch (pcu->read_buf[0]) { case IMS_PCU_RSP_EVNT_BUTTONS: if (likely(pcu->setup_complete)) ims_pcu_report_events(pcu); break; default: /* * See if we got command completion. * If both the sequence and response code match save * the data a...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,295
static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id) { int error; error = ims_pcu_execute_query(pcu, GET_DEVICE_ID); if (error) { dev_err(pcu->dev, "GET_DEVICE_ID command failed, error: %d\n", error); return error; } *device_id = pcu->cmd_buf[IMS_PCU_DATA_OFFSET]; dev_dbg(pcu->dev, "Detec...
DoS
0
static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id) { int error; error = ims_pcu_execute_query(pcu, GET_DEVICE_ID); if (error) { dev_err(pcu->dev, "GET_DEVICE_ID command failed, error: %d\n", error); return error; } *device_id = pcu->cmd_buf[IMS_PCU_DATA_OFFSET]; dev_dbg(pcu->dev, "Detec...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,296
static int ims_pcu_init_application_mode(struct ims_pcu *pcu) { static atomic_t device_no = ATOMIC_INIT(-1); const struct ims_pcu_device_info *info; int error; error = ims_pcu_get_device_info(pcu); if (error) { /* Device does not respond to basic queries, hopeless */ return error; } error = ims_pcu_identi...
DoS
0
static int ims_pcu_init_application_mode(struct ims_pcu *pcu) { static atomic_t device_no = ATOMIC_INIT(-1); const struct ims_pcu_device_info *info; int error; error = ims_pcu_get_device_info(pcu); if (error) { /* Device does not respond to basic queries, hopeless */ return error; } error = ims_pcu_identi...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,297
static int ims_pcu_init_bootloader_mode(struct ims_pcu *pcu) { int error; error = ims_pcu_execute_bl_command(pcu, QUERY_DEVICE, NULL, 0, IMS_PCU_CMD_RESPONSE_TIMEOUT); if (error) { dev_err(pcu->dev, "Bootloader does not respond, aborting\n"); return error; } pcu->fw_start_addr = get_unaligned_le32(...
DoS
0
static int ims_pcu_init_bootloader_mode(struct ims_pcu *pcu) { int error; error = ims_pcu_execute_bl_command(pcu, QUERY_DEVICE, NULL, 0, IMS_PCU_CMD_RESPONSE_TIMEOUT); if (error) { dev_err(pcu->dev, "Bootloader does not respond, aborting\n"); return error; } pcu->fw_start_addr = get_unaligned_le32(...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,298
static void ims_pcu_irq(struct urb *urb) { struct ims_pcu *pcu = urb->context; int retval, status; status = urb->status; switch (status) { case 0: /* success */ break; case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ dev_dbg(pcu->dev, "%s - urb shutting down with...
DoS
0
static void ims_pcu_irq(struct urb *urb) { struct ims_pcu *pcu = urb->context; int retval, status; status = urb->status; switch (status) { case 0: /* success */ break; case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ dev_dbg(pcu->dev, "%s - urb shutting down with...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null
43,299
static umode_t ims_pcu_is_attr_visible(struct kobject *kobj, struct attribute *attr, int n) { struct device *dev = container_of(kobj, struct device, kobj); struct usb_interface *intf = to_usb_interface(dev); struct ims_pcu *pcu = usb_get_intfdata(intf); umode_t mode = attr->mode; if (pcu->bootloader_mo...
DoS
0
static umode_t ims_pcu_is_attr_visible(struct kobject *kobj, struct attribute *attr, int n) { struct device *dev = container_of(kobj, struct device, kobj); struct usb_interface *intf = to_usb_interface(dev); struct ims_pcu *pcu = usb_get_intfdata(intf); umode_t mode = attr->mode; if (pcu->bootloader_mo...
@@ -1663,13 +1663,17 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc pcu->ctrl_intf = usb_ifnum_to_if(pcu->udev, union_desc->bMasterInterface0); + if (!pcu->ctrl_intf) + return -EINVAL; alt = pcu->ctrl_intf->cur_altsetting; pcu->ep_ctrl = &alt->endpoint[0].desc; p...
null
null
null