idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
34,500
struct inode *__udf_iget(struct super_block *sb, struct kernel_lb_addr *ino, bool hidden_inode) { unsigned long block = udf_get_lb_pblock(sb, ino, 0); struct inode *inode = iget_locked(sb, block); int err; if (!inode) return ERR_PTR(-ENOMEM); if (!(inode->i_state & I_NEW)) return inode; memcpy(&UDF_I(i...
DoS Overflow
0
struct inode *__udf_iget(struct super_block *sb, struct kernel_lb_addr *ino, bool hidden_inode) { unsigned long block = udf_get_lb_pblock(sb, ino, 0); struct inode *inode = iget_locked(sb, block); int err; if (!inode) return ERR_PTR(-ENOMEM); if (!(inode->i_state & I_NEW)) return inode; memcpy(&UDF_I(i...
@@ -1487,6 +1487,15 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) } inode->i_generation = iinfo->i_unique; + /* + * Sanity check length of allocation descriptors and extended attrs to + * avoid integer overflows + */ + if (iinfo->i_lenEAttr > bs || iinfo->i_lenAlloc > bs) + goto out; + ...
CWE-189
null
null
34,501
int udf_setsize(struct inode *inode, loff_t newsize) { int err; struct udf_inode_info *iinfo; int bsize = 1 << inode->i_blkbits; if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) return -EINVAL; if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) return -EPERM; iinfo = UDF_I...
DoS Overflow
0
int udf_setsize(struct inode *inode, loff_t newsize) { int err; struct udf_inode_info *iinfo; int bsize = 1 << inode->i_blkbits; if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) return -EINVAL; if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) return -EPERM; iinfo = UDF_I...
@@ -1487,6 +1487,15 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) } inode->i_generation = iinfo->i_unique; + /* + * Sanity check length of allocation descriptors and extended attrs to + * avoid integer overflows + */ + if (iinfo->i_lenEAttr > bs || iinfo->i_lenAlloc > bs) + goto out; + ...
CWE-189
null
null
34,502
static int iov_num_pages(void __user *iov_base, size_t iov_len) { return (PAGE_ALIGN((unsigned long)iov_base + iov_len) - ((unsigned long)iov_base & PAGE_MASK)) >> PAGE_SHIFT; }
DoS Overflow Mem. Corr.
0
static int iov_num_pages(void __user *iov_base, size_t iov_len) { return (PAGE_ALIGN((unsigned long)iov_base + iov_len) - ((unsigned long)iov_base & PAGE_MASK)) >> PAGE_SHIFT; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,503
static void vhost_scsi_aborted_task(struct se_cmd *se_cmd) { return; }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_aborted_task(struct se_cmd *se_cmd) { return; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,504
vhost_scsi_alloc_fabric_acl(struct se_portal_group *se_tpg) { struct vhost_scsi_nacl *nacl; nacl = kzalloc(sizeof(struct vhost_scsi_nacl), GFP_KERNEL); if (!nacl) { pr_err("Unable to allocate struct vhost_scsi_nacl\n"); return NULL; } return &nacl->se_node_acl; }
DoS Overflow Mem. Corr.
0
vhost_scsi_alloc_fabric_acl(struct se_portal_group *se_tpg) { struct vhost_scsi_nacl *nacl; nacl = kzalloc(sizeof(struct vhost_scsi_nacl), GFP_KERNEL); if (!nacl) { pr_err("Unable to allocate struct vhost_scsi_nacl\n"); return NULL; } return &nacl->se_node_acl; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,505
vhost_scsi_calc_sgls(struct iov_iter *iter, size_t bytes, int max_sgls) { int sgl_count = 0; if (!iter || !iter->iov) { pr_err("%s: iter->iov is NULL, but expected bytes: %zu" " present\n", __func__, bytes); return -EINVAL; } sgl_count = iov_iter_npages(iter, 0xffff); if (sgl_count > max_sgls) { p...
DoS Overflow Mem. Corr.
0
vhost_scsi_calc_sgls(struct iov_iter *iter, size_t bytes, int max_sgls) { int sgl_count = 0; if (!iter || !iter->iov) { pr_err("%s: iter->iov is NULL, but expected bytes: %zu" " present\n", __func__, bytes); return -EINVAL; } sgl_count = iov_iter_npages(iter, 0xffff); if (sgl_count > max_sgls) { p...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,506
static int vhost_scsi_check_false(struct se_portal_group *se_tpg) { return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_check_false(struct se_portal_group *se_tpg) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,507
static int vhost_scsi_check_stop_free(struct se_cmd *se_cmd) { return target_put_sess_cmd(se_cmd->se_sess, se_cmd); }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_check_stop_free(struct se_cmd *se_cmd) { return target_put_sess_cmd(se_cmd->se_sess, se_cmd); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,508
static int vhost_scsi_check_true(struct se_portal_group *se_tpg) { return 1; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_check_true(struct se_portal_group *se_tpg) { return 1; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,509
vhost_scsi_clear_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { struct se_portal_group *se_tpg; struct vhost_scsi_tport *tv_tport; struct vhost_scsi_tpg *tpg; struct vhost_virtqueue *vq; bool match = false; int index, ret, i; u8 target; mutex_lock(&vhost_scsi_mutex); mutex_lock(&vs->dev.m...
DoS Overflow Mem. Corr.
0
vhost_scsi_clear_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { struct se_portal_group *se_tpg; struct vhost_scsi_tport *tv_tport; struct vhost_scsi_tpg *tpg; struct vhost_virtqueue *vq; bool match = false; int index, ret, i; u8 target; mutex_lock(&vhost_scsi_mutex); mutex_lock(&vs->dev.m...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,510
static void vhost_scsi_close_session(struct se_session *se_sess) { return; }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_close_session(struct se_session *se_sess) { return; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,511
static long vhost_scsi_compat_ioctl(struct file *f, unsigned int ioctl, unsigned long arg) { return vhost_scsi_ioctl(f, ioctl, (unsigned long)compat_ptr(arg)); }
DoS Overflow Mem. Corr.
0
static long vhost_scsi_compat_ioctl(struct file *f, unsigned int ioctl, unsigned long arg) { return vhost_scsi_ioctl(f, ioctl, (unsigned long)compat_ptr(arg)); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,512
static void vhost_scsi_complete_cmd_work(struct vhost_work *work) { struct vhost_scsi *vs = container_of(work, struct vhost_scsi, vs_completion_work); DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ); struct virtio_scsi_cmd_resp v_rsp; struct vhost_scsi_cmd *cmd; struct llist_node *llnode; struct se_cmd *se_cmd; s...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_complete_cmd_work(struct vhost_work *work) { struct vhost_scsi *vs = container_of(work, struct vhost_scsi, vs_completion_work); DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ); struct virtio_scsi_cmd_resp v_rsp; struct vhost_scsi_cmd *cmd; struct llist_node *llnode; struct se_cmd *se_cmd; s...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,513
static int vhost_scsi_deregister(void) { return misc_deregister(&vhost_scsi_misc); }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_deregister(void) { return misc_deregister(&vhost_scsi_misc); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,514
static void vhost_scsi_deregister_configfs(void) { if (!vhost_scsi_fabric_configfs) return; target_fabric_configfs_deregister(vhost_scsi_fabric_configfs); vhost_scsi_fabric_configfs = NULL; pr_debug("TCM_VHOST[0] - Cleared vhost_scsi_fabric_configfs\n"); };
DoS Overflow Mem. Corr.
0
static void vhost_scsi_deregister_configfs(void) { if (!vhost_scsi_fabric_configfs) return; target_fabric_configfs_deregister(vhost_scsi_fabric_configfs); vhost_scsi_fabric_configfs = NULL; pr_debug("TCM_VHOST[0] - Cleared vhost_scsi_fabric_configfs\n"); };
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,515
vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) { struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; struct virtio_scsi_event *event = &evt->event; struct virtio_scsi_event __user *eventp; unsigned out, in; int head, ret; if (!vq->private_data) { vs->vs_events_missed = true;...
DoS Overflow Mem. Corr.
0
vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) { struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; struct virtio_scsi_event *event = &evt->event; struct virtio_scsi_event __user *eventp; unsigned out, in; int head, ret; if (!vq->private_data) { vs->vs_events_missed = true;...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,516
vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg, struct se_lun *lun, bool plug) { struct vhost_scsi *vs = tpg->vhost_scsi; struct vhost_virtqueue *vq; u32 reason; if (!vs) return; mutex_lock(&vs->dev.mutex); if (plug) reason = VIRTIO_SCSI_EVT_RESET_RESCAN; else reason = VIRTIO_SCSI_EVT_RESET_REMOVED;...
DoS Overflow Mem. Corr.
0
vhost_scsi_do_plug(struct vhost_scsi_tpg *tpg, struct se_lun *lun, bool plug) { struct vhost_scsi *vs = tpg->vhost_scsi; struct vhost_virtqueue *vq; u32 reason; if (!vs) return; mutex_lock(&vs->dev.mutex); if (plug) reason = VIRTIO_SCSI_EVT_RESET_RESCAN; else reason = VIRTIO_SCSI_EVT_RESET_REMOVED;...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,517
static void vhost_scsi_done_inflight(struct kref *kref) { struct vhost_scsi_inflight *inflight; inflight = container_of(kref, struct vhost_scsi_inflight, kref); complete(&inflight->comp); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_done_inflight(struct kref *kref) { struct vhost_scsi_inflight *inflight; inflight = container_of(kref, struct vhost_scsi_inflight, kref); complete(&inflight->comp); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,518
static int vhost_scsi_drop_nexus(struct vhost_scsi_tpg *tpg) { struct se_session *se_sess; struct vhost_scsi_nexus *tv_nexus; mutex_lock(&tpg->tv_tpg_mutex); tv_nexus = tpg->tpg_nexus; if (!tv_nexus) { mutex_unlock(&tpg->tv_tpg_mutex); return -ENODEV; } se_sess = tv_nexus->tvn_se_sess; if (!se_sess) { m...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_drop_nexus(struct vhost_scsi_tpg *tpg) { struct se_session *se_sess; struct vhost_scsi_nexus *tv_nexus; mutex_lock(&tpg->tv_tpg_mutex); tv_nexus = tpg->tpg_nexus; if (!tv_nexus) { mutex_unlock(&tpg->tv_tpg_mutex); return -ENODEV; } se_sess = tv_nexus->tvn_se_sess; if (!se_sess) { m...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,519
static void vhost_scsi_drop_nodeacl(struct se_node_acl *se_acl) { struct vhost_scsi_nacl *nacl = container_of(se_acl, struct vhost_scsi_nacl, se_node_acl); core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1); kfree(nacl); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_drop_nodeacl(struct se_node_acl *se_acl) { struct vhost_scsi_nacl *nacl = container_of(se_acl, struct vhost_scsi_nacl, se_node_acl); core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1); kfree(nacl); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,520
static void vhost_scsi_evt_work(struct vhost_work *work) { struct vhost_scsi *vs = container_of(work, struct vhost_scsi, vs_event_work); struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; struct vhost_scsi_evt *evt; struct llist_node *llnode; mutex_lock(&vq->mutex); llnode = llist_del_all(&vs->vs_...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_evt_work(struct vhost_work *work) { struct vhost_scsi *vs = container_of(work, struct vhost_scsi, vs_event_work); struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; struct vhost_scsi_evt *evt; struct llist_node *llnode; mutex_lock(&vq->mutex); llnode = llist_del_all(&vs->vs_...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,521
static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index) { vhost_poll_flush(&vs->vqs[index].vq.poll); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index) { vhost_poll_flush(&vs->vqs[index].vq.poll); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,522
static void vhost_scsi_free_cmd_map_res(struct vhost_scsi_nexus *nexus, struct se_session *se_sess) { struct vhost_scsi_cmd *tv_cmd; unsigned int i; if (!se_sess->sess_cmd_map) return; for (i = 0; i < VHOST_SCSI_DEFAULT_TAGS; i++) { tv_cmd = &((struct vhost_scsi_cmd *)se_sess->sess_cmd_map)[i]; ...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_free_cmd_map_res(struct vhost_scsi_nexus *nexus, struct se_session *se_sess) { struct vhost_scsi_cmd *tv_cmd; unsigned int i; if (!se_sess->sess_cmd_map) return; for (i = 0; i < VHOST_SCSI_DEFAULT_TAGS; i++) { tv_cmd = &((struct vhost_scsi_cmd *)se_sess->sess_cmd_map)[i]; ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,523
static void vhost_scsi_free_evt(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) { vs->vs_events_nr--; kfree(evt); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_free_evt(struct vhost_scsi *vs, struct vhost_scsi_evt *evt) { vs->vs_events_nr--; kfree(evt); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,524
static int vhost_scsi_get_cmd_state(struct se_cmd *se_cmd) { return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_get_cmd_state(struct se_cmd *se_cmd) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,525
static char *vhost_scsi_get_fabric_name(void) { return "vhost"; }
DoS Overflow Mem. Corr.
0
static char *vhost_scsi_get_fabric_name(void) { return "vhost"; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,526
static u8 vhost_scsi_get_fabric_proto_ident(struct se_portal_group *se_tpg) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->tport_proto_id) { case SCSI_PROTOCOL_SAS: return sas_get_fabric_proto_ident(se_tpg); cas...
DoS Overflow Mem. Corr.
0
static u8 vhost_scsi_get_fabric_proto_ident(struct se_portal_group *se_tpg) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->tport_proto_id) { case SCSI_PROTOCOL_SAS: return sas_get_fabric_proto_ident(se_tpg); cas...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,527
vhost_scsi_get_inflight(struct vhost_virtqueue *vq) { struct vhost_scsi_inflight *inflight; struct vhost_scsi_virtqueue *svq; svq = container_of(vq, struct vhost_scsi_virtqueue, vq); inflight = &svq->inflights[svq->inflight_idx]; kref_get(&inflight->kref); return inflight; }
DoS Overflow Mem. Corr.
0
vhost_scsi_get_inflight(struct vhost_virtqueue *vq) { struct vhost_scsi_inflight *inflight; struct vhost_scsi_virtqueue *svq; svq = container_of(vq, struct vhost_scsi_virtqueue, vq); inflight = &svq->inflights[svq->inflight_idx]; kref_get(&inflight->kref); return inflight; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,528
vhost_scsi_get_pr_transport_id_len(struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, int *format_code) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->...
DoS Overflow Mem. Corr.
0
vhost_scsi_get_pr_transport_id_len(struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, int *format_code) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,529
vhost_scsi_get_tag(struct vhost_virtqueue *vq, struct vhost_scsi_tpg *tpg, unsigned char *cdb, u64 scsi_tag, u16 lun, u8 task_attr, u32 exp_data_len, int data_direction) { struct vhost_scsi_cmd *cmd; struct vhost_scsi_nexus *tv_nexus; struct se_session *se_sess; struct scatterlist *sg, *prot_sg; struct p...
DoS Overflow Mem. Corr.
0
vhost_scsi_get_tag(struct vhost_virtqueue *vq, struct vhost_scsi_tpg *tpg, unsigned char *cdb, u64 scsi_tag, u16 lun, u8 task_attr, u32 exp_data_len, int data_direction) { struct vhost_scsi_cmd *cmd; struct vhost_scsi_nexus *tv_nexus; struct se_session *se_sess; struct scatterlist *sg, *prot_sg; struct p...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,530
static u32 vhost_scsi_get_task_tag(struct se_cmd *se_cmd) { return 0; }
DoS Overflow Mem. Corr.
0
static u32 vhost_scsi_get_task_tag(struct se_cmd *se_cmd) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,531
static void vhost_scsi_handle_kick(struct vhost_work *work) { struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, poll.work); struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev); vhost_scsi_handle_vq(vs, vq); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_handle_kick(struct vhost_work *work) { struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, poll.work); struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev); vhost_scsi_handle_vq(vs, vq); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,532
vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) { struct vhost_scsi_tpg **vs_tpg, *tpg; struct virtio_scsi_cmd_req v_req; struct virtio_scsi_cmd_req_pi v_req_pi; struct vhost_scsi_cmd *cmd; struct iov_iter out_iter, in_iter, prot_iter, data_iter; u64 tag; u32 exp_data_len, data_direction;...
DoS Overflow Mem. Corr.
0
vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) { struct vhost_scsi_tpg **vs_tpg, *tpg; struct virtio_scsi_cmd_req v_req; struct virtio_scsi_cmd_req_pi v_req_pi; struct vhost_scsi_cmd *cmd; struct iov_iter out_iter, in_iter, prot_iter, data_iter; u64 tag; u32 exp_data_len, data_direction;...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,533
static void vhost_scsi_hotplug(struct vhost_scsi_tpg *tpg, struct se_lun *lun) { vhost_scsi_do_plug(tpg, lun, true); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_hotplug(struct vhost_scsi_tpg *tpg, struct se_lun *lun) { vhost_scsi_do_plug(tpg, lun, true); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,534
static void vhost_scsi_hotunplug(struct vhost_scsi_tpg *tpg, struct se_lun *lun) { vhost_scsi_do_plug(tpg, lun, false); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_hotunplug(struct vhost_scsi_tpg *tpg, struct se_lun *lun) { vhost_scsi_do_plug(tpg, lun, false); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,535
static int __init vhost_scsi_init(void) { int ret = -ENOMEM; /* * Use our own dedicated workqueue for submitting I/O into * target core to avoid contention within system_wq. */ vhost_scsi_workqueue = alloc_workqueue("vhost_scsi", 0, 0); if (!vhost_scsi_workqueue) goto out; ret = vhost_scsi_register(); if...
DoS Overflow Mem. Corr.
0
static int __init vhost_scsi_init(void) { int ret = -ENOMEM; /* * Use our own dedicated workqueue for submitting I/O into * target core to avoid contention within system_wq. */ vhost_scsi_workqueue = alloc_workqueue("vhost_scsi", 0, 0); if (!vhost_scsi_workqueue) goto out; ret = vhost_scsi_register(); if...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,536
static void vhost_scsi_init_inflight(struct vhost_scsi *vs, struct vhost_scsi_inflight *old_inflight[]) { struct vhost_scsi_inflight *new_inflight; struct vhost_virtqueue *vq; int idx, i; for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) { vq = &vs->vqs[i].vq; mutex_lock(&vq->mutex); /* store old infight */ ...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_init_inflight(struct vhost_scsi *vs, struct vhost_scsi_inflight *old_inflight[]) { struct vhost_scsi_inflight *new_inflight; struct vhost_virtqueue *vq; int idx, i; for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) { vq = &vs->vqs[i].vq; mutex_lock(&vq->mutex); /* store old infight */ ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,537
vhost_scsi_iov_to_sgl(struct vhost_scsi_cmd *cmd, bool write, struct iov_iter *iter, struct scatterlist *sg, int sg_count) { size_t off = iter->iov_offset; int i, ret; for (i = 0; i < iter->nr_segs; i++) { void __user *base = iter->iov[i].iov_base + off; size_t len = iter->iov[i].iov_len - off; ...
DoS Overflow Mem. Corr.
0
vhost_scsi_iov_to_sgl(struct vhost_scsi_cmd *cmd, bool write, struct iov_iter *iter, struct scatterlist *sg, int sg_count) { size_t off = iter->iov_offset; int i, ret; for (i = 0; i < iter->nr_segs; i++) { void __user *base = iter->iov[i].iov_base + off; size_t len = iter->iov[i].iov_len - off; ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,538
static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg, const char *name) { struct se_portal_group *se_tpg; struct se_session *se_sess; struct vhost_scsi_nexus *tv_nexus; struct vhost_scsi_cmd *tv_cmd; unsigned int i; mutex_lock(&tpg->tv_tpg_mutex); if (tpg->tpg_nexus) { mutex_unlock(&tpg->tv_tpg_mut...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg, const char *name) { struct se_portal_group *se_tpg; struct se_session *se_sess; struct vhost_scsi_nexus *tv_nexus; struct vhost_scsi_cmd *tv_cmd; unsigned int i; mutex_lock(&tpg->tv_tpg_mutex); if (tpg->tpg_nexus) { mutex_unlock(&tpg->tv_tpg_mut...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,539
vhost_scsi_make_nodeacl(struct se_portal_group *se_tpg, struct config_group *group, const char *name) { struct se_node_acl *se_nacl, *se_nacl_new; struct vhost_scsi_nacl *nacl; u64 wwpn = 0; u32 nexus_depth; /* vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ se_nacl_new ...
DoS Overflow Mem. Corr.
0
vhost_scsi_make_nodeacl(struct se_portal_group *se_tpg, struct config_group *group, const char *name) { struct se_node_acl *se_nacl, *se_nacl_new; struct vhost_scsi_nacl *nacl; u64 wwpn = 0; u32 nexus_depth; /* vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ se_nacl_new ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,540
vhost_scsi_make_tport(struct target_fabric_configfs *tf, struct config_group *group, const char *name) { struct vhost_scsi_tport *tport; char *ptr; u64 wwpn = 0; int off = 0; /* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ tport = kzalloc(sizeof(struct vhost_scsi_tpo...
DoS Overflow Mem. Corr.
0
vhost_scsi_make_tport(struct target_fabric_configfs *tf, struct config_group *group, const char *name) { struct vhost_scsi_tport *tport; char *ptr; u64 wwpn = 0; int off = 0; /* if (vhost_scsi_parse_wwn(name, &wwpn, 1) < 0) return ERR_PTR(-EINVAL); */ tport = kzalloc(sizeof(struct vhost_scsi_tpo...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,541
vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd, void __user *ptr, size_t len, struct scatterlist *sgl, bool write) { unsigned int npages = 0, offset, nbytes; unsigned int pages_nr = iov_num_pages(ptr, len); struct scatterlist *sg = sgl; struct page **pages = cmd->tvc_upages; int r...
DoS Overflow Mem. Corr.
0
vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd, void __user *ptr, size_t len, struct scatterlist *sgl, bool write) { unsigned int npages = 0, offset, nbytes; unsigned int pages_nr = iov_num_pages(ptr, len); struct scatterlist *sg = sgl; struct page **pages = cmd->tvc_upages; int r...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,542
vhost_scsi_mapal(struct vhost_scsi_cmd *cmd, size_t prot_bytes, struct iov_iter *prot_iter, size_t data_bytes, struct iov_iter *data_iter) { int sgl_count, ret; bool write = (cmd->tvc_data_direction == DMA_FROM_DEVICE); if (prot_bytes) { sgl_count = vhost_scsi_calc_sgls(prot_iter, prot_bytes, VHOST_S...
DoS Overflow Mem. Corr.
0
vhost_scsi_mapal(struct vhost_scsi_cmd *cmd, size_t prot_bytes, struct iov_iter *prot_iter, size_t data_bytes, struct iov_iter *data_iter) { int sgl_count, ret; bool write = (cmd->tvc_data_direction == DMA_FROM_DEVICE); if (prot_bytes) { sgl_count = vhost_scsi_calc_sgls(prot_iter, prot_bytes, VHOST_S...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,543
static int vhost_scsi_open(struct inode *inode, struct file *f) { struct vhost_scsi *vs; struct vhost_virtqueue **vqs; int r = -ENOMEM, i; vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); if (!vs) { vs = vzalloc(sizeof(*vs)); if (!vs) goto err_vs; } vqs = kmalloc(VHOST_SCSI_MAX_VQ * ...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_open(struct inode *inode, struct file *f) { struct vhost_scsi *vs; struct vhost_virtqueue **vqs; int r = -ENOMEM, i; vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); if (!vs) { vs = vzalloc(sizeof(*vs)); if (!vs) goto err_vs; } vqs = kmalloc(VHOST_SCSI_MAX_VQ * ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,544
vhost_scsi_parse_pr_out_transport_id(struct se_portal_group *se_tpg, const char *buf, u32 *out_tid_len, char **port_nexus_ptr) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->tport_proto_id) {...
DoS Overflow Mem. Corr.
0
vhost_scsi_parse_pr_out_transport_id(struct se_portal_group *se_tpg, const char *buf, u32 *out_tid_len, char **port_nexus_ptr) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport = tpg->tport; switch (tport->tport_proto_id) {...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,545
static int vhost_scsi_port_link(struct se_portal_group *se_tpg, struct se_lun *lun) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); mutex_lock(&vhost_scsi_mutex); mutex_lock(&tpg->tv_tpg_mutex); tpg->tv_tpg_port_count++; mutex_unlock(&tpg->tv_tpg_mutex); vhost_...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_port_link(struct se_portal_group *se_tpg, struct se_lun *lun) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); mutex_lock(&vhost_scsi_mutex); mutex_lock(&tpg->tv_tpg_mutex); tpg->tv_tpg_port_count++; mutex_unlock(&tpg->tv_tpg_mutex); vhost_...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,546
static void vhost_scsi_port_unlink(struct se_portal_group *se_tpg, struct se_lun *lun) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); mutex_lock(&vhost_scsi_mutex); mutex_lock(&tpg->tv_tpg_mutex); tpg->tv_tpg_port_count--; mutex_unlock(&tpg->tv_tpg_mutex); vhost_s...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_port_unlink(struct se_portal_group *se_tpg, struct se_lun *lun) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); mutex_lock(&vhost_scsi_mutex); mutex_lock(&tpg->tv_tpg_mutex); tpg->tv_tpg_port_count--; mutex_unlock(&tpg->tv_tpg_mutex); vhost_s...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,547
static void vhost_scsi_put_inflight(struct vhost_scsi_inflight *inflight) { kref_put(&inflight->kref, vhost_scsi_done_inflight); }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_put_inflight(struct vhost_scsi_inflight *inflight) { kref_put(&inflight->kref, vhost_scsi_done_inflight); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,548
static int vhost_scsi_queue_data_in(struct se_cmd *se_cmd) { struct vhost_scsi_cmd *cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); vhost_scsi_complete_cmd(cmd); return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_queue_data_in(struct se_cmd *se_cmd) { struct vhost_scsi_cmd *cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); vhost_scsi_complete_cmd(cmd); return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,549
static void vhost_scsi_queue_tm_rsp(struct se_cmd *se_cmd) { return; }
DoS Overflow Mem. Corr.
0
static void vhost_scsi_queue_tm_rsp(struct se_cmd *se_cmd) { return; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,550
static int __init vhost_scsi_register(void) { return misc_register(&vhost_scsi_misc); }
DoS Overflow Mem. Corr.
0
static int __init vhost_scsi_register(void) { return misc_register(&vhost_scsi_misc); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,551
static int vhost_scsi_register_configfs(void) { struct target_fabric_configfs *fabric; int ret; pr_debug("vhost-scsi fabric module %s on %s/%s" " on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); /* * Register the top level struct config_item_type with TCM core */ fabric = ...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_register_configfs(void) { struct target_fabric_configfs *fabric; int ret; pr_debug("vhost-scsi fabric module %s on %s/%s" " on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); /* * Register the top level struct config_item_type with TCM core */ fabric = ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,552
static int vhost_scsi_release(struct inode *inode, struct file *f) { struct vhost_scsi *vs = f->private_data; struct vhost_scsi_target t; mutex_lock(&vs->dev.mutex); memcpy(t.vhost_wwpn, vs->vs_vhost_wwpn, sizeof(t.vhost_wwpn)); mutex_unlock(&vs->dev.mutex); vhost_scsi_clear_endpoint(vs, &t); vhost_dev_stop(&vs...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_release(struct inode *inode, struct file *f) { struct vhost_scsi *vs = f->private_data; struct vhost_scsi_target t; mutex_lock(&vs->dev.mutex); memcpy(t.vhost_wwpn, vs->vs_vhost_wwpn, sizeof(t.vhost_wwpn)); mutex_unlock(&vs->dev.mutex); vhost_scsi_clear_endpoint(vs, &t); vhost_dev_stop(&vs...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,553
static void vhost_scsi_release_cmd(struct se_cmd *se_cmd) { struct vhost_scsi_cmd *tv_cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); struct se_session *se_sess = tv_cmd->tvc_nexus->tvn_se_sess; int i; if (tv_cmd->tvc_sgl_count) { for (i = 0; i < tv_cmd->tvc_sgl_count; i++) put_page(sg_page...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_release_cmd(struct se_cmd *se_cmd) { struct vhost_scsi_cmd *tv_cmd = container_of(se_cmd, struct vhost_scsi_cmd, tvc_se_cmd); struct se_session *se_sess = tv_cmd->tvc_nexus->tvn_se_sess; int i; if (tv_cmd->tvc_sgl_count) { for (i = 0; i < tv_cmd->tvc_sgl_count; i++) put_page(sg_page...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,554
static u32 vhost_scsi_sess_get_index(struct se_session *se_sess) { return 0; }
DoS Overflow Mem. Corr.
0
static u32 vhost_scsi_sess_get_index(struct se_session *se_sess) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,555
vhost_scsi_set_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { struct se_portal_group *se_tpg; struct vhost_scsi_tport *tv_tport; struct vhost_scsi_tpg *tpg; struct vhost_scsi_tpg **vs_tpg; struct vhost_virtqueue *vq; int index, ret, i, len; bool match = false; mutex_lock(&vhost_scsi_mutex); ...
DoS Overflow Mem. Corr.
0
vhost_scsi_set_endpoint(struct vhost_scsi *vs, struct vhost_scsi_target *t) { struct se_portal_group *se_tpg; struct vhost_scsi_tport *tv_tport; struct vhost_scsi_tpg *tpg; struct vhost_scsi_tpg **vs_tpg; struct vhost_virtqueue *vq; int index, ret, i, len; bool match = false; mutex_lock(&vhost_scsi_mutex); ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,556
static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) { struct vhost_virtqueue *vq; int i; if (features & ~VHOST_SCSI_FEATURES) return -EOPNOTSUPP; mutex_lock(&vs->dev.mutex); if ((features & (1 << VHOST_F_LOG_ALL)) && !vhost_log_access_ok(&vs->dev)) { mutex_unlock(&vs->dev.mutex); r...
DoS Overflow Mem. Corr.
0
static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) { struct vhost_virtqueue *vq; int i; if (features & ~VHOST_SCSI_FEATURES) return -EOPNOTSUPP; mutex_lock(&vs->dev.mutex); if ((features & (1 << VHOST_F_LOG_ALL)) && !vhost_log_access_ok(&vs->dev)) { mutex_unlock(&vs->dev.mutex); r...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,557
static int vhost_scsi_shutdown_session(struct se_session *se_sess) { return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_shutdown_session(struct se_session *se_sess) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,558
static void vhost_scsi_submission_work(struct work_struct *work) { struct vhost_scsi_cmd *cmd = container_of(work, struct vhost_scsi_cmd, work); struct vhost_scsi_nexus *tv_nexus; struct se_cmd *se_cmd = &cmd->tvc_se_cmd; struct scatterlist *sg_ptr, *sg_prot_ptr = NULL; int rc; /* FIXME: BIDI operation */ if ...
DoS Overflow Mem. Corr.
0
static void vhost_scsi_submission_work(struct work_struct *work) { struct vhost_scsi_cmd *cmd = container_of(work, struct vhost_scsi_cmd, work); struct vhost_scsi_nexus *tv_nexus; struct se_cmd *se_cmd = &cmd->tvc_se_cmd; struct scatterlist *sg_ptr, *sg_prot_ptr = NULL; int rc; /* FIXME: BIDI operation */ if ...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,559
static u32 vhost_scsi_tpg_get_inst_index(struct se_portal_group *se_tpg) { return 1; }
DoS Overflow Mem. Corr.
0
static u32 vhost_scsi_tpg_get_inst_index(struct se_portal_group *se_tpg) { return 1; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,560
static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg, char *page) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_nexus *tv_nexus; ssize_t ret; mutex_lock(&tpg->tv_tpg_mutex); tv_nexus = tpg->tpg_nexus; if (!tv_nexus) { mutex_unl...
DoS Overflow Mem. Corr.
0
static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg, char *page) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_nexus *tv_nexus; ssize_t ret; mutex_lock(&tpg->tv_tpg_mutex); tv_nexus = tpg->tpg_nexus; if (!tv_nexus) { mutex_unl...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,561
static ssize_t vhost_scsi_tpg_store_nexus(struct se_portal_group *se_tpg, const char *page, size_t count) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport_wwn = tpg->tport; unsigned char i_port[VHOST_SCSI_NAMELEN], *ptr, *port_ptr; in...
DoS Overflow Mem. Corr.
0
static ssize_t vhost_scsi_tpg_store_nexus(struct se_portal_group *se_tpg, const char *page, size_t count) { struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg, se_tpg); struct vhost_scsi_tport *tport_wwn = tpg->tport; unsigned char i_port[VHOST_SCSI_NAMELEN], *ptr, *port_ptr; in...
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,562
static int vhost_scsi_write_pending(struct se_cmd *se_cmd) { /* Go ahead and process the write immediately */ target_execute_cmd(se_cmd); return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_write_pending(struct se_cmd *se_cmd) { /* Go ahead and process the write immediately */ target_execute_cmd(se_cmd); return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,563
static int vhost_scsi_write_pending_status(struct se_cmd *se_cmd) { return 0; }
DoS Overflow Mem. Corr.
0
static int vhost_scsi_write_pending_status(struct se_cmd *se_cmd) { return 0; }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,564
vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, char *page) { return sprintf(page, "TCM_VHOST fabric module %s on %s/%s" "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); }
DoS Overflow Mem. Corr.
0
vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, char *page) { return sprintf(page, "TCM_VHOST fabric module %s on %s/%s" "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, utsname()->machine); }
@@ -1249,7 +1249,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, * lun[4-7] need to be zero according to virtio-scsi spec. */ evt->event.lun[0] = 0x01; - evt->event.lun[1] = tpg->tport_tpgt & 0xFF; + evt->event.lun[1] = tpg->tport_tpgt; if (lun->unpacked_lun >= 256) evt->event.lun[2] = lun->unpacked...
CWE-119
null
null
34,565
int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, const u8 *data, int data_len) { unsigned wvalue = le16_to_cpu(setup->wValue); unsigned windex = le16_to_cpu(setup->wIndex); unsigned wlength = le16_to_cpu(setup->wLength); int rc = 0; if ((setup->bRequestType & USB_TYPE_MASK) == USB_TY...
DoS
0
int oz_usb_control_req(void *hpd, u8 req_id, struct usb_ctrlrequest *setup, const u8 *data, int data_len) { unsigned wvalue = le16_to_cpu(setup->wValue); unsigned windex = le16_to_cpu(setup->wIndex); unsigned wlength = le16_to_cpu(setup->wLength); int rc = 0; if ((setup->bRequestType & USB_TYPE_MASK) == USB_TY...
@@ -326,7 +326,10 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->data; - int n = (len - sizeof(struct oz_multiple_fixed)+1) + int n; + if (!body->unit_size) + break; + n = (len - sizeof(stru...
CWE-189
null
null
34,566
void oz_usb_farewell(struct oz_pd *pd, u8 ep_num, u8 *data, u8 len) { struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_APPID_USB]); if (usb_ctx == NULL) return; /*...
DoS
0
void oz_usb_farewell(struct oz_pd *pd, u8 ep_num, u8 *data, u8 len) { struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_APPID_USB]); if (usb_ctx == NULL) return; /*...
@@ -326,7 +326,10 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->data; - int n = (len - sizeof(struct oz_multiple_fixed)+1) + int n; + if (!body->unit_size) + break; + n = (len - sizeof(stru...
CWE-189
null
null
34,567
void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt) { struct oz_usb_hdr *usb_hdr = (struct oz_usb_hdr *)(elt + 1); struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_...
DoS
0
void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt) { struct oz_usb_hdr *usb_hdr = (struct oz_usb_hdr *)(elt + 1); struct oz_usb_ctx *usb_ctx; spin_lock_bh(&pd->app_lock[OZ_APPID_USB]); usb_ctx = (struct oz_usb_ctx *)pd->app_ctx[OZ_APPID_USB]; if (usb_ctx) oz_usb_get(usb_ctx); spin_unlock_bh(&pd->app_lock[OZ_...
@@ -326,7 +326,10 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->data; - int n = (len - sizeof(struct oz_multiple_fixed)+1) + int n; + if (!body->unit_size) + break; + n = (len - sizeof(stru...
CWE-189
null
null
34,568
static int oz_usb_set_config_req(void *hpd, u8 req_id, u8 index) { struct oz_usb_ctx *usb_ctx = hpd; struct oz_pd *pd = usb_ctx->pd; struct oz_elt *elt; struct oz_elt_buf *eb = &pd->elt_buff; struct oz_elt_info *ei = oz_elt_info_alloc(&pd->elt_buff); struct oz_set_config_req *body; if (ei == NULL) return -1; ...
DoS
0
static int oz_usb_set_config_req(void *hpd, u8 req_id, u8 index) { struct oz_usb_ctx *usb_ctx = hpd; struct oz_pd *pd = usb_ctx->pd; struct oz_elt *elt; struct oz_elt_buf *eb = &pd->elt_buff; struct oz_elt_info *ei = oz_elt_info_alloc(&pd->elt_buff); struct oz_set_config_req *body; if (ei == NULL) return -1; ...
@@ -326,7 +326,10 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->data; - int n = (len - sizeof(struct oz_multiple_fixed)+1) + int n; + if (!body->unit_size) + break; + n = (len - sizeof(stru...
CWE-189
null
null
34,569
static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type, u8 request, __le16 value, __le16 index, const u8 *data, int data_len) { struct oz_usb_ctx *usb_ctx = hpd; struct oz_pd *pd = usb_ctx->pd; struct oz_elt *elt; struct oz_elt_buf *eb = &pd->elt_buff; struct oz_elt_info *ei = oz_elt_info_alloc(&pd-...
DoS
0
static int oz_usb_vendor_class_req(void *hpd, u8 req_id, u8 req_type, u8 request, __le16 value, __le16 index, const u8 *data, int data_len) { struct oz_usb_ctx *usb_ctx = hpd; struct oz_pd *pd = usb_ctx->pd; struct oz_elt *elt; struct oz_elt_buf *eb = &pd->elt_buff; struct oz_elt_info *ei = oz_elt_info_alloc(&pd-...
@@ -326,7 +326,10 @@ static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->data; - int n = (len - sizeof(struct oz_multiple_fixed)+1) + int n; + if (!body->unit_size) + break; + n = (len - sizeof(stru...
CWE-189
null
null
34,570
static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_usb_hdr *usb_hdr, int len) { struct oz_data *data_hdr = (struct oz_data *)usb_hdr; switch (data_hdr->format) { case OZ_DATA_F_MULTIPLE_FIXED: { struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->d...
DoS Exec Code Overflow
0
static void oz_usb_handle_ep_data(struct oz_usb_ctx *usb_ctx, struct oz_usb_hdr *usb_hdr, int len) { struct oz_data *data_hdr = (struct oz_data *)usb_hdr; switch (data_hdr->format) { case OZ_DATA_F_MULTIPLE_FIXED: { struct oz_multiple_fixed *body = (struct oz_multiple_fixed *)data_hdr; u8 *data = body->d...
@@ -390,10 +390,15 @@ void oz_usb_rx(struct oz_pd *pd, struct oz_elt *elt) case OZ_GET_DESC_RSP: { struct oz_get_desc_rsp *body = (struct oz_get_desc_rsp *)usb_hdr; - int data_len = elt->length - - sizeof(struct oz_get_desc_rsp) + 1; - u16 offs = le16_to_cpu(get_unaligned(&body->offset)); - u16 tot...
CWE-119
null
null
34,571
static void oz_acquire_port(struct oz_port *port, void *hpd) { INIT_LIST_HEAD(&port->isoc_out_ep); INIT_LIST_HEAD(&port->isoc_in_ep); port->flags |= OZ_PORT_F_PRESENT | OZ_PORT_F_CHANGED; port->status |= USB_PORT_STAT_CONNECTION | (USB_PORT_STAT_C_CONNECTION << 16); oz_usb_get(hpd); port->hpd = hpd; }
DoS Exec Code
0
static void oz_acquire_port(struct oz_port *port, void *hpd) { INIT_LIST_HEAD(&port->isoc_out_ep); INIT_LIST_HEAD(&port->isoc_in_ep); port->flags |= OZ_PORT_F_PRESENT | OZ_PORT_F_CHANGED; port->status |= USB_PORT_STAT_CONNECTION | (USB_PORT_STAT_C_CONNECTION << 16); oz_usb_get(hpd); port->hpd = hpd; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,572
static struct oz_urb_link *oz_alloc_urb_link(void) { return kmem_cache_alloc(oz_urb_link_cache, GFP_ATOMIC); }
DoS Exec Code
0
static struct oz_urb_link *oz_alloc_urb_link(void) { return kmem_cache_alloc(oz_urb_link_cache, GFP_ATOMIC); }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,573
static int oz_build_endpoints_for_config(struct usb_hcd *hcd, struct oz_port *port, struct usb_host_config *config, gfp_t mem_flags) { struct oz_hcd *ozhcd = port->ozhcd; int i; int num_iface = config->desc.bNumInterfaces; if (num_iface) { struct oz_interface *iface; iface = kmalloc_array(num_iface, sizeo...
DoS Exec Code
0
static int oz_build_endpoints_for_config(struct usb_hcd *hcd, struct oz_port *port, struct usb_host_config *config, gfp_t mem_flags) { struct oz_hcd *ozhcd = port->ozhcd; int i; int num_iface = config->desc.bNumInterfaces; if (num_iface) { struct oz_interface *iface; iface = kmalloc_array(num_iface, sizeo...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,574
static void oz_clean_endpoints_for_config(struct usb_hcd *hcd, struct oz_port *port) { struct oz_hcd *ozhcd = port->ozhcd; int i; oz_dbg(ON, "Deleting endpoints for configuration\n"); for (i = 0; i < port->num_iface; i++) oz_clean_endpoints_for_interface(hcd, port, i); spin_lock_bh(&ozhcd->hcd_lock); if (po...
DoS Exec Code
0
static void oz_clean_endpoints_for_config(struct usb_hcd *hcd, struct oz_port *port) { struct oz_hcd *ozhcd = port->ozhcd; int i; oz_dbg(ON, "Deleting endpoints for configuration\n"); for (i = 0; i < port->num_iface; i++) oz_clean_endpoints_for_interface(hcd, port, i); spin_lock_bh(&ozhcd->hcd_lock); if (po...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,575
static void oz_clean_endpoints_for_interface(struct usb_hcd *hcd, struct oz_port *port, int if_ix) { struct oz_hcd *ozhcd = port->ozhcd; unsigned mask; int i; LIST_HEAD(ep_list); struct oz_endpoint *ep, *n; oz_dbg(ON, "Deleting endpoints for interface %d\n", if_ix); if (if_ix >= port->num_iface) return; s...
DoS Exec Code
0
static void oz_clean_endpoints_for_interface(struct usb_hcd *hcd, struct oz_port *port, int if_ix) { struct oz_hcd *ozhcd = port->ozhcd; unsigned mask; int i; LIST_HEAD(ep_list); struct oz_endpoint *ep, *n; oz_dbg(ON, "Deleting endpoints for interface %d\n", if_ix); if (if_ix >= port->num_iface) return; s...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,576
static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) { struct oz_port *port; u8 port_id = (u8)windex; struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned clear_bits = 0; if ((port_id < 1) || (port_id > OZ_NB_PORTS)) return -EPIPE; port = &ozhcd->ports[port_id-1]; switch (wvalue) { c...
DoS Exec Code
0
static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex) { struct oz_port *port; u8 port_id = (u8)windex; struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned clear_bits = 0; if ((port_id < 1) || (port_id > OZ_NB_PORTS)) return -EPIPE; port = &ozhcd->ports[port_id-1]; switch (wvalue) { c...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,577
static void oz_complete_urb(struct usb_hcd *hcd, struct urb *urb, int status) { struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned long irq_state; struct oz_urb_link *cancel_urbl; spin_lock_irqsave(&g_tasklet_lock, irq_state); usb_hcd_unlink_urb_from_ep(hcd, urb); /* Clear hcpriv which will prevent it being ...
DoS Exec Code
0
static void oz_complete_urb(struct usb_hcd *hcd, struct urb *urb, int status) { struct oz_hcd *ozhcd = oz_hcd_private(hcd); unsigned long irq_state; struct oz_urb_link *cancel_urbl; spin_lock_irqsave(&g_tasklet_lock, irq_state); usb_hcd_unlink_urb_from_ep(hcd, urb); /* Clear hcpriv which will prevent it being ...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,578
static int oz_dequeue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir, struct urb *urb) { struct oz_urb_link *urbl = NULL; struct oz_endpoint *ep; spin_lock_bh(&port->ozhcd->hcd_lock); if (in_dir) ep = port->in_ep[ep_addr]; else ep = port->out_ep[ep_addr]; if (ep) { struct list_head *e; list_for_...
DoS Exec Code
0
static int oz_dequeue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir, struct urb *urb) { struct oz_urb_link *urbl = NULL; struct oz_endpoint *ep; spin_lock_bh(&port->ozhcd->hcd_lock); if (in_dir) ep = port->in_ep[ep_addr]; else ep = port->out_ep[ep_addr]; if (ep) { struct list_head *e; list_for_...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,579
static void oz_display_conf_type(u8 t) { switch (t) { case USB_REQ_GET_STATUS: oz_dbg(ON, "USB_REQ_GET_STATUS - cnf\n"); break; case USB_REQ_CLEAR_FEATURE: oz_dbg(ON, "USB_REQ_CLEAR_FEATURE - cnf\n"); break; case USB_REQ_SET_FEATURE: oz_dbg(ON, "USB_REQ_SET_FEATURE - cnf\n"); break; case USB_REQ_SET_AD...
DoS Exec Code
0
static void oz_display_conf_type(u8 t) { switch (t) { case USB_REQ_GET_STATUS: oz_dbg(ON, "USB_REQ_GET_STATUS - cnf\n"); break; case USB_REQ_CLEAR_FEATURE: oz_dbg(ON, "USB_REQ_CLEAR_FEATURE - cnf\n"); break; case USB_REQ_SET_FEATURE: oz_dbg(ON, "USB_REQ_SET_FEATURE - cnf\n"); break; case USB_REQ_SET_AD...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,580
static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir, struct urb *urb, u8 req_id) { struct oz_urb_link *urbl; struct oz_endpoint *ep = NULL; int err = 0; if (ep_addr >= OZ_NB_ENDPOINTS) { oz_dbg(ON, "%s: Invalid endpoint number\n", __func__); return -EINVAL; } urbl = oz_alloc_urb_link...
DoS Exec Code
0
static int oz_enqueue_ep_urb(struct oz_port *port, u8 ep_addr, int in_dir, struct urb *urb, u8 req_id) { struct oz_urb_link *urbl; struct oz_endpoint *ep = NULL; int err = 0; if (ep_addr >= OZ_NB_ENDPOINTS) { oz_dbg(ON, "%s: Invalid endpoint number\n", __func__); return -EINVAL; } urbl = oz_alloc_urb_link...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,581
static void oz_free_urb_link(struct oz_urb_link *urbl) { if (!urbl) return; kmem_cache_free(oz_urb_link_cache, urbl); }
DoS Exec Code
0
static void oz_free_urb_link(struct oz_urb_link *urbl) { if (!urbl) return; kmem_cache_free(oz_urb_link_cache, urbl); }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,582
static void oz_get_hub_descriptor(struct usb_hcd *hcd, struct usb_hub_descriptor *desc) { memset(desc, 0, sizeof(*desc)); desc->bDescriptorType = 0x29; desc->bDescLength = 9; desc->wHubCharacteristics = cpu_to_le16(0x0001); desc->bNbrPorts = OZ_NB_PORTS; }
DoS Exec Code
0
static void oz_get_hub_descriptor(struct usb_hcd *hcd, struct usb_hub_descriptor *desc) { memset(desc, 0, sizeof(*desc)); desc->bDescriptorType = 0x29; desc->bDescLength = 9; desc->wHubCharacteristics = cpu_to_le16(0x0001); desc->bNbrPorts = OZ_NB_PORTS; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,583
static int oz_get_port_from_addr(struct oz_hcd *ozhcd, u8 bus_addr) { int i; for (i = 0; i < OZ_NB_PORTS; i++) { if (ozhcd->ports[i].bus_addr == bus_addr) return i; } return ozhcd->conn_port; }
DoS Exec Code
0
static int oz_get_port_from_addr(struct oz_hcd *ozhcd, u8 bus_addr) { int i; for (i = 0; i < OZ_NB_PORTS; i++) { if (ozhcd->ports[i].bus_addr == bus_addr) return i; } return ozhcd->conn_port; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,584
static int oz_get_port_status(struct usb_hcd *hcd, u16 windex, char *buf) { struct oz_hcd *ozhcd; u32 status; if ((windex < 1) || (windex > OZ_NB_PORTS)) return -EPIPE; ozhcd = oz_hcd_private(hcd); oz_dbg(HUB, "GetPortStatus windex = %d\n", windex); status = ozhcd->ports[windex-1].status; put_unaligned(cpu_to...
DoS Exec Code
0
static int oz_get_port_status(struct usb_hcd *hcd, u16 windex, char *buf) { struct oz_hcd *ozhcd; u32 status; if ((windex < 1) || (windex > OZ_NB_PORTS)) return -EPIPE; ozhcd = oz_hcd_private(hcd); oz_dbg(HUB, "GetPortStatus windex = %d\n", windex); status = ozhcd->ports[windex-1].status; put_unaligned(cpu_to...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,585
static int oz_hcd_buffer_data(struct oz_endpoint *ep, const u8 *data, int data_len) { int space; int copy_len; if (!ep->buffer) return -1; space = ep->out_ix-ep->in_ix-1; if (space < 0) space += ep->buffer_size; if (space < (data_len+1)) { oz_dbg(ON, "Buffer full\n"); return -1; } ep->buffer[e...
DoS Exec Code
0
static int oz_hcd_buffer_data(struct oz_endpoint *ep, const u8 *data, int data_len) { int space; int copy_len; if (!ep->buffer) return -1; space = ep->out_ix-ep->in_ix-1; if (space < 0) space += ep->buffer_size; if (space < (data_len+1)) { oz_dbg(ON, "Buffer full\n"); return -1; } ep->buffer[e...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,586
static int oz_hcd_bus_suspend(struct usb_hcd *hcd) { struct oz_hcd *ozhcd; ozhcd = oz_hcd_private(hcd); spin_lock_bh(&ozhcd->hcd_lock); hcd->state = HC_STATE_SUSPENDED; ozhcd->flags |= OZ_HDC_F_SUSPENDED; spin_unlock_bh(&ozhcd->hcd_lock); return 0; }
DoS Exec Code
0
static int oz_hcd_bus_suspend(struct usb_hcd *hcd) { struct oz_hcd *ozhcd; ozhcd = oz_hcd_private(hcd); spin_lock_bh(&ozhcd->hcd_lock); hcd->state = HC_STATE_SUSPENDED; ozhcd->flags |= OZ_HDC_F_SUSPENDED; spin_unlock_bh(&ozhcd->hcd_lock); return 0; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,587
static struct oz_hcd *oz_hcd_claim(void) { struct oz_hcd *ozhcd; spin_lock_bh(&g_hcdlock); ozhcd = g_ozhcd; if (ozhcd) usb_get_hcd(ozhcd->hcd); spin_unlock_bh(&g_hcdlock); return ozhcd; }
DoS Exec Code
0
static struct oz_hcd *oz_hcd_claim(void) { struct oz_hcd *ozhcd; spin_lock_bh(&g_hcdlock); ozhcd = g_ozhcd; if (ozhcd) usb_get_hcd(ozhcd->hcd); spin_unlock_bh(&g_hcdlock); return ozhcd; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,588
static void oz_hcd_clear_orphanage(struct oz_hcd *ozhcd, int status) { if (ozhcd) { struct oz_urb_link *urbl, *n; list_for_each_entry_safe(urbl, n, &ozhcd->orphanage, link) { list_del(&urbl->link); oz_complete_urb(ozhcd->hcd, urbl->urb, status); oz_free_urb_link(urbl); } } }
DoS Exec Code
0
static void oz_hcd_clear_orphanage(struct oz_hcd *ozhcd, int status) { if (ozhcd) { struct oz_urb_link *urbl, *n; list_for_each_entry_safe(urbl, n, &ozhcd->orphanage, link) { list_del(&urbl->link); oz_complete_urb(ozhcd->hcd, urbl->urb, status); oz_free_urb_link(urbl); } } }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,589
static void oz_hcd_complete_set_config(struct oz_port *port, struct urb *urb, u8 rcode, u8 config_num) { int rc = 0; struct usb_hcd *hcd = port->ozhcd->hcd; if (rcode == 0) { port->config_num = config_num; oz_clean_endpoints_for_config(hcd, port); if (oz_build_endpoints_for_config(hcd, port, &urb->dev->c...
DoS Exec Code
0
static void oz_hcd_complete_set_config(struct oz_port *port, struct urb *urb, u8 rcode, u8 config_num) { int rc = 0; struct usb_hcd *hcd = port->ozhcd->hcd; if (rcode == 0) { port->config_num = config_num; oz_clean_endpoints_for_config(hcd, port); if (oz_build_endpoints_for_config(hcd, port, &urb->dev->c...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,590
void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, const u8 *data, int data_len) { struct oz_port *port = hport; struct urb *urb; struct usb_ctrlrequest *setup; struct usb_hcd *hcd = port->ozhcd->hcd; unsigned windex; unsigned wvalue; oz_dbg(ON, "oz_hcd_control_cnf rcode=%u len=%d\n", rcode, data_len); ...
DoS Exec Code
0
void oz_hcd_control_cnf(void *hport, u8 req_id, u8 rcode, const u8 *data, int data_len) { struct oz_port *port = hport; struct urb *urb; struct usb_ctrlrequest *setup; struct usb_hcd *hcd = port->ozhcd->hcd; unsigned windex; unsigned wvalue; oz_dbg(ON, "oz_hcd_control_cnf rcode=%u len=%d\n", rcode, data_len); ...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,591
void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len) { struct oz_port *port = (struct oz_port *)hport; struct oz_endpoint *ep; struct oz_hcd *ozhcd = port->ozhcd; spin_lock_bh(&ozhcd->hcd_lock); ep = port->in_ep[endpoint & USB_ENDPOINT_NUMBER_MASK]; if (ep == NULL) goto done; switch (e...
DoS Exec Code
0
void oz_hcd_data_ind(void *hport, u8 endpoint, const u8 *data, int data_len) { struct oz_port *port = (struct oz_port *)hport; struct oz_endpoint *ep; struct oz_hcd *ozhcd = port->ozhcd; spin_lock_bh(&ozhcd->hcd_lock); ep = port->in_ep[endpoint & USB_ENDPOINT_NUMBER_MASK]; if (ep == NULL) goto done; switch (e...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,592
static void oz_hcd_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) { }
DoS Exec Code
0
static void oz_hcd_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *ep) { }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,593
static int oz_hcd_get_frame_number(struct usb_hcd *hcd) { oz_dbg(ON, "oz_hcd_get_frame_number\n"); return oz_usb_get_frame_number(); }
DoS Exec Code
0
static int oz_hcd_get_frame_number(struct usb_hcd *hcd) { oz_dbg(ON, "oz_hcd_get_frame_number\n"); return oz_usb_get_frame_number(); }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,594
static int oz_hcd_hub_control(struct usb_hcd *hcd, u16 req_type, u16 wvalue, u16 windex, char *buf, u16 wlength) { int err = 0; switch (req_type) { case ClearHubFeature: oz_dbg(HUB, "ClearHubFeature: %d\n", req_type); break; case ClearPortFeature: err = oz_clear_port_feature(hcd, wvalue, windex); break...
DoS Exec Code
0
static int oz_hcd_hub_control(struct usb_hcd *hcd, u16 req_type, u16 wvalue, u16 windex, char *buf, u16 wlength) { int err = 0; switch (req_type) { case ClearHubFeature: oz_dbg(HUB, "ClearHubFeature: %d\n", req_type); break; case ClearPortFeature: err = oz_clear_port_feature(hcd, wvalue, windex); break...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,595
int oz_hcd_init(void) { int err; if (usb_disabled()) return -ENODEV; oz_urb_link_cache = KMEM_CACHE(oz_urb_link, 0); if (!oz_urb_link_cache) return -ENOMEM; tasklet_init(&g_urb_process_tasklet, oz_urb_process_tasklet, 0); tasklet_init(&g_urb_cancel_tasklet, oz_urb_cancel_tasklet, 0); err = platform_driver...
DoS Exec Code
0
int oz_hcd_init(void) { int err; if (usb_disabled()) return -ENODEV; oz_urb_link_cache = KMEM_CACHE(oz_urb_link, 0); if (!oz_urb_link_cache) return -ENOMEM; tasklet_init(&g_urb_process_tasklet, oz_urb_process_tasklet, 0); tasklet_init(&g_urb_cancel_tasklet, oz_urb_cancel_tasklet, 0); err = platform_driver...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,596
struct oz_port *oz_hcd_pd_arrived(void *hpd) { int i; struct oz_port *hport; struct oz_hcd *ozhcd; struct oz_endpoint *ep; ozhcd = oz_hcd_claim(); if (!ozhcd) return NULL; /* Allocate an endpoint object in advance (before holding hcd lock) to * use for out endpoint 0. */ ep = oz_ep_alloc(0, GFP_ATOMIC); ...
DoS Exec Code
0
struct oz_port *oz_hcd_pd_arrived(void *hpd) { int i; struct oz_port *hport; struct oz_hcd *ozhcd; struct oz_endpoint *ep; ozhcd = oz_hcd_claim(); if (!ozhcd) return NULL; /* Allocate an endpoint object in advance (before holding hcd lock) to * use for out endpoint 0. */ ep = oz_ep_alloc(0, GFP_ATOMIC); ...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,597
void oz_hcd_pd_departed(struct oz_port *port) { struct oz_hcd *ozhcd; void *hpd; struct oz_endpoint *ep = NULL; if (port == NULL) { oz_dbg(ON, "%s: port = 0\n", __func__); return; } ozhcd = port->ozhcd; if (ozhcd == NULL) return; /* Check if this is the connection port - if so clear it. */ spin_lock_b...
DoS Exec Code
0
void oz_hcd_pd_departed(struct oz_port *port) { struct oz_hcd *ozhcd; void *hpd; struct oz_endpoint *ep = NULL; if (port == NULL) { oz_dbg(ON, "%s: port = 0\n", __func__); return; } ozhcd = port->ozhcd; if (ozhcd == NULL) return; /* Check if this is the connection port - if so clear it. */ spin_lock_b...
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,598
static inline struct oz_hcd *oz_hcd_private(struct usb_hcd *hcd) { return (struct oz_hcd *)hcd->hcd_priv; }
DoS Exec Code
0
static inline struct oz_hcd *oz_hcd_private(struct usb_hcd *hcd) { return (struct oz_hcd *)hcd->hcd_priv; }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null
34,599
static inline void oz_hcd_put(struct oz_hcd *ozhcd) { if (ozhcd) usb_put_hcd(ozhcd->hcd); }
DoS Exec Code
0
static inline void oz_hcd_put(struct oz_hcd *ozhcd) { if (ozhcd) usb_put_hcd(ozhcd->hcd); }
@@ -746,8 +746,8 @@ void oz_hcd_pd_reset(void *hpd, void *hport) /* * Context: softirq */ -void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, - int length, int offset, int total_size) +void oz_hcd_get_desc_cnf(void *hport, u8 req_id, u8 status, const u8 *desc, + u8 length, u16 offset,...
CWE-189
null
null