The following issues were found
drivers/usb/core/devio.c
1 issues
Line: 312
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* 18 bytes - fits on the stack */
struct usb_device_descriptor temp_desc;
memcpy(&temp_desc, &dev->descriptor, sizeof(dev->descriptor));
le16_to_cpus(&temp_desc.bcdUSB);
le16_to_cpus(&temp_desc.idVendor);
le16_to_cpus(&temp_desc.idProduct);
le16_to_cpus(&temp_desc.bcdDevice);
Reported by FlawFinder.
drivers/scsi/megaraid/megaraid_sas_debugfs.c
1 issues
Line: 124
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
void
megasas_setup_debugfs(struct megasas_instance *instance)
{
char name[64];
struct fusion_context *fusion;
fusion = instance->ctrl_context;
if (fusion) {
Reported by FlawFinder.
drivers/scsi/ufs/ufshcd.h
1 issues
Line: 847
Column: 11
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
bool is_urgent_bkops_lvl_checked;
struct rw_semaphore clk_scaling_lock;
unsigned char desc_size[QUERY_DESC_IDN_MAX];
atomic_t scsi_block_reqs_cnt;
struct device bsg_dev;
struct request_queue *bsg_queue;
struct delayed_work rpm_dev_flush_recheck_work;
Reported by FlawFinder.
drivers/video/fbdev/nvidia/nv_backlight.c
1 issues
Line: 91
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
struct backlight_properties props;
struct fb_info *info = pci_get_drvdata(par->pci_dev);
struct backlight_device *bd;
char name[12];
if (!par->FlatPanel)
return;
#ifdef CONFIG_PMAC_BACKLIGHT
Reported by FlawFinder.
drivers/usb/core/quirks.c
1 issues
Line: 26
Column: 8
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 struct quirk_entry *quirk_list;
static unsigned int quirk_count;
static char quirks_param[128];
static int quirks_param_set(const char *value, const struct kernel_param *kp)
{
char *val, *p, *field;
u16 vid, pid;
Reported by FlawFinder.
drivers/scsi/ufs/ufshcd-pltfrm.c
1 issues
Line: 109
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
static int ufshcd_populate_vreg(struct device *dev, const char *name,
struct ufs_vreg **out_vreg)
{
char prop_name[MAX_PROP_SIZE];
struct ufs_vreg *vreg = NULL;
struct device_node *np = dev->of_node;
if (!np) {
dev_err(dev, "%s: non DT initialization\n", __func__);
Reported by FlawFinder.
drivers/usb/dwc2/core.h
1 issues
Line: 186
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
unsigned int next_desc;
unsigned int compl_desc;
char name[10];
};
/**
* struct dwc2_hsotg_req - data transfer request
* @req: The USB gadget request
Reported by FlawFinder.
drivers/usb/dwc2/hcd_intr.c
1 issues
Line: 956
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
dev_vdbg(hsotg->dev, "non-aligned buffer\n");
dma_unmap_single(hsotg->dev, chan->qh->dw_align_buf_dma,
DWC2_KMEM_UNALIGNED_BUF_SIZE, DMA_FROM_DEVICE);
memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma),
chan->qh->dw_align_buf, len);
}
qtd->isoc_split_offset += len;
Reported by FlawFinder.
drivers/usb/dwc3/core.h
1 issues
Line: 747
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
u32 frame_number;
u32 interval;
char name[20];
unsigned direction:1;
unsigned stream_capable:1;
/* For isochronous START TRANSFER workaround only */
Reported by FlawFinder.
drivers/usb/dwc3/debug.h
1 issues
Line: 376
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
union dwc3_event evt;
memcpy(&evt, &event, sizeof(event));
if (evt.type.is_devspec)
return dwc3_gadget_event_string(str, size, &evt.devt);
else
return dwc3_ep_event_string(str, size, &evt.depevt, ep0state);
Reported by FlawFinder.