The following issues were found
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
1 issues
Line: 991
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto no_reserve;
}
memcpy(ttm_kmap_obj_virtual(&map, &is_iomem), bytecode, size);
WARN_ON(is_iomem);
ttm_bo_kunmap(&map);
ret = ttm_bo_validate(&buf->base, &vmw_sys_placement, &ctx);
WARN_ON(ret != 0);
Reported by FlawFinder.
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
1 issues
Line: 236
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto out_err;
} else {
fifo_mem = dev_priv->fifo_mem;
memcpy(bounce, &fifo_mem[SVGA_FIFO_3D_CAPS], size);
}
ret = copy_to_user(buffer, bounce, size);
if (ret)
ret = -EFAULT;
Reported by FlawFinder.
drivers/infiniband/hw/cxgb4/cq.c
1 issues
Line: 803
CWE codes:
476
wc->opcode = IB_WC_RECV;
wc->ex.invalidate_rkey = CQE_WRID_STAG(&cqe);
wc->wc_flags |= IB_WC_WITH_INVALIDATE;
c4iw_invalidate_mr(qhp->rhp, wc->ex.invalidate_rkey);
break;
case FW_RI_WRITE_IMMEDIATE:
wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
wc->ex.imm_data = CQE_IMM_DATA(&cqe);
wc->wc_flags |= IB_WC_WITH_IMM;
Reported by Cppcheck.
drivers/gpu/drm/i915/gt/uc/intel_guc.c
1 issues
Line: 212
u32 offset = intel_guc_ggtt_offset(guc, guc->log.vma) >> PAGE_SHIFT;
u32 flags;
#if (((CRASH_BUFFER_SIZE) % SZ_1M) == 0)
#define UNIT SZ_1M
#define FLAG GUC_LOG_ALLOC_IN_MEGABYTE
#else
#define UNIT SZ_4K
#define FLAG 0
Reported by Cppcheck.
drivers/infiniband/hw/cxgb4/mem.c
1 issues
Line: 170
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
to_dp = (u8 *)(sc + 1);
from_dp = (u8 *)data + i * C4IW_MAX_INLINE_SIZE;
if (data)
memcpy(to_dp, from_dp, copy_len);
else
memset(to_dp, 0, copy_len);
if (copy_len % T4_ULPTX_MIN_IO)
memset(to_dp + copy_len, 0, T4_ULPTX_MIN_IO -
(copy_len % T4_ULPTX_MIN_IO));
Reported by FlawFinder.
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
1 issues
Line: 629
Column: 15
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
*/
static int vmw_dma_select_mode(struct vmw_private *dev_priv)
{
static const char *names[vmw_dma_map_max] = {
[vmw_dma_phys] = "Using physical TTM page addresses.",
[vmw_dma_alloc_coherent] = "Using coherent TTM pages.",
[vmw_dma_map_populate] = "Caching DMA mappings.",
[vmw_dma_map_bind] = "Giving up DMA mappings early."};
Reported by FlawFinder.
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
1 issues
Line: 447
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
DRM_ERROR("Failed mapping new COTable on resize.\n");
goto out_map_new;
}
memcpy(ttm_kmap_obj_virtual(&new_map, &dummy),
ttm_kmap_obj_virtual(&old_map, &dummy),
PAGE_SIZE);
ttm_bo_kunmap(&new_map);
ttm_bo_kunmap(&old_map);
}
Reported by FlawFinder.
drivers/infiniband/hw/cxgb4/t4.h
1 issues
Line: 103
Column: 28
CWE codes:
120
20
struct fw_ri_wr ri;
struct fw_ri_rdma_write_wr write;
struct fw_ri_send_wr send;
struct fw_ri_rdma_read_wr read;
struct fw_ri_bind_mw_wr bind;
struct fw_ri_fr_nsmr_wr fr;
struct fw_ri_fr_nsmr_tpte_wr fr_tpte;
struct fw_ri_inv_lstag_wr inv;
struct fw_ri_rdma_write_cmpl_wr write_cmpl;
Reported by FlawFinder.
drivers/infiniband/hw/cxgb4/t4fw_ri_api.h
1 issues
Line: 799
Column: 31
CWE codes:
120
20
__be64 r5;
union fw_ri_init_p2p {
struct fw_ri_rdma_write_wr write;
struct fw_ri_rdma_read_wr read;
struct fw_ri_send_wr send;
} u;
} init;
struct fw_ri_fini {
__u8 type;
Reported by FlawFinder.
drivers/infiniband/hw/efa/efa.h
1 issues
Line: 33
Column: 2
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
int cpu;
u32 vector;
cpumask_t affinity_hint_mask;
char name[EFA_IRQNAME_SIZE];
};
/* Don't use anything other than atomic64 */
struct efa_stats {
atomic64_t alloc_pd_err;
Reported by FlawFinder.