The following issues were found
drivers/tty/sysrq.c
1 issues
Line: 639
Column: 23
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 sysrq_reset_downtime_ms;
/* Simple translation table for the SysRq keys */
static const unsigned char sysrq_xlate[KEY_CNT] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"bnm,./\000*\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
"\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */
Reported by FlawFinder.
drivers/soc/amlogic/meson-gx-pwrc-vpu.c
1 issues
Line: 292
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!vpu_pd)
return -ENOMEM;
memcpy(vpu_pd, vpu_pd_match, sizeof(*vpu_pd));
regmap_ao = syscon_node_to_regmap(of_get_parent(pdev->dev.of_node));
if (IS_ERR(regmap_ao)) {
dev_err(&pdev->dev, "failed to get regmap\n");
return PTR_ERR(regmap_ao);
Reported by FlawFinder.
drivers/slimbus/slimbus.h
1 issues
Line: 403
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 slim_controller {
struct device *dev;
unsigned int id;
char name[SLIMBUS_NAME_SIZE];
int min_cg;
int max_cg;
int clkgear;
struct ida laddr_ida;
struct slim_framer *a_framer;
Reported by FlawFinder.
drivers/tty/vcc.c
1 issues
Line: 834
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!tosend)
break;
memcpy(&pkt->data[port->chars_in_buffer], &buf[total_sent],
tosend);
port->chars_in_buffer += tosend;
pkt->tag.stype = tosend;
vccdbg("TAG [%02x:%02x:%04x:%08x]\n", pkt->tag.type,
Reported by FlawFinder.
drivers/slimbus/messaging.c
1 issues
Line: 45
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
slim_free_txn_tid(ctrl, txn);
memcpy(msg->rbuf, reply, len);
if (txn->comp)
complete(txn->comp);
/* Remove runtime-pm vote now that response was received for TID txn */
pm_runtime_mark_last_busy(ctrl->dev);
Reported by FlawFinder.
drivers/tty/vt/vt_ioctl.c
1 issues
Line: 790
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
int rc;
console_lock();
memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode));
console_unlock();
rc = copy_to_user(up, &tmp, sizeof(struct vt_mode));
if (rc)
return -EFAULT;
Reported by FlawFinder.
drivers/sh/superhyway/superhyway.c
1 issues
Line: 85
Column: 2
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
dev->dev.release = superhyway_device_release;
dev->id.id = dev->vcr.mod_id;
sprintf(dev->name, "SuperHyway device %04x", dev->id.id);
dev_set_name(&dev->dev, "%02x", superhyway_devices);
superhyway_devices++;
return device_register(&dev->dev);
Reported by FlawFinder.
drivers/sh/superhyway/superhyway-sysfs.c
1 issues
Line: 21
Column: 9
CWE codes:
134
Suggestion:
Make format string constant
static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
{ \
struct superhyway_device *s = to_superhyway_device(dev); \
return sprintf(buf, fmt, s->field); \
} \
static DEVICE_ATTR_RO(name);
/* VCR flags */
superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags);
Reported by FlawFinder.
drivers/sh/intc/userimask.c
1 issues
Line: 26
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
show_intc_userimask(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf);
}
static ssize_t
store_intc_userimask(struct device *dev,
struct device_attribute *attr,
Reported by FlawFinder.
drivers/sh/intc/chip.c
1 issues
Line: 159
Column: 17
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
#define SENSE_VALID_FLAG 0x80
#define VALID(x) (x | SENSE_VALID_FLAG)
static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
[IRQ_TYPE_EDGE_FALLING] = VALID(0),
[IRQ_TYPE_EDGE_RISING] = VALID(1),
[IRQ_TYPE_LEVEL_LOW] = VALID(2),
/* SH7706, SH7707 and SH7709 do not support high level triggered */
#if !defined(CONFIG_CPU_SUBTYPE_SH7706) && \
Reported by FlawFinder.