The following issues were found
drivers/crypto/gemini/sl3516-ce.h
1 issues
Line: 199
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
struct pkt_control_ecb {
struct pkt_control_header control;
struct pkt_control_cipher cipher;
unsigned char key[AES_MAX_KEY_SIZE];
};
/*
* struct sl3516_ce_dev - main container for all this driver information
* @base: base address
Reported by FlawFinder.
drivers/acpi/nfit/nfit.h
1 issues
Line: 226
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
enum nvdimm_fwa_state fwa_state;
enum nvdimm_fwa_result fwa_result;
int fwa_count;
char id[NFIT_DIMM_ID_LEN+1];
struct resource *flush_wpq;
unsigned long dsm_mask;
unsigned long flags;
u32 dirty_shutdown;
int family;
Reported by FlawFinder.
drivers/acpi/nfit/intel.c
1 issues
Line: 17
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
struct nvdimm_bus_descriptor *nd_desc = to_nd_desc(nvdimm_bus);
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
return sprintf(buf, "%s\n", acpi_desc->fwa_noidle ? "Y" : "N");
}
static ssize_t firmware_activate_noidle_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t size)
{
Reported by FlawFinder.
drivers/crypto/hisilicon/sec/sec_drv.h
1 issues
Line: 338
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 sec_queue {
struct sec_dev_info *dev_info;
int task_irq;
char name[SEC_NAME_SIZE];
struct sec_queue_ring_cmd ring_cmd;
struct sec_queue_ring_cq ring_cq;
struct sec_queue_ring_db ring_db;
void __iomem *regs;
u32 queue_id;
Reported by FlawFinder.
drivers/acpi/irq.c
1 issues
Line: 239
CWE codes:
908
static int acpi_irq_parse_one(acpi_handle handle, unsigned int index,
struct irq_fwspec *fwspec, unsigned long *flags)
{
struct acpi_irq_parse_one_ctx ctx = { -EINVAL, index, flags, fwspec };
acpi_walk_resources(handle, METHOD_NAME__CRS, acpi_irq_parse_one_cb, &ctx);
return ctx.rc;
}
Reported by Cppcheck.
drivers/crypto/img-hash.c
1 issues
Line: 278
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!req->result)
return -EINVAL;
memcpy(req->result, ctx->digest, ctx->digsize);
return 0;
}
static void img_hash_copy_hash(struct ahash_request *req)
Reported by FlawFinder.
drivers/crypto/inside-secure/safexcel.h
1 issues
drivers/crypto/keembay/ocs-aes.c
1 issues
Line: 906
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
tag_u32[2] = __swab32(ioread32(aes_dev->base_reg + AES_T_MAC_1_OFFSET));
tag_u32[3] = __swab32(ioread32(aes_dev->base_reg + AES_T_MAC_0_OFFSET));
memcpy(tag, tag_u32, tag_size);
}
/**
* ocs_aes_gcm_op() - Perform GCM operation.
* @aes_dev: The OCS AES device to use.
Reported by FlawFinder.
drivers/crypto/keembay/ocs-hcu.c
1 issues
Line: 400
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return -EINVAL;
/* Copy key into temporary u32 array. */
memcpy(key_u32, key, len);
/*
* Hardware requires all the bytes of the HW Key vector to be
* written. So pad with zero until we reach OCS_HCU_HW_KEY_LEN.
*/
Reported by FlawFinder.
drivers/crypto/marvell/cesa/cesa.c
1 issues
Line: 491
Column: 3
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
for (i = 0; i < caps->nengines; i++) {
struct mv_cesa_engine *engine = &cesa->engines[i];
char res_name[7];
engine->id = i;
spin_lock_init(&engine->lock);
ret = mv_cesa_get_sram(pdev, i);
Reported by FlawFinder.