The following issues were found
drivers/input/mouse/vmmouse.c
2 issues
Line: 75
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 vmmouse_data {
struct input_dev *abs_dev;
char phys[32];
char dev_name[128];
};
/*
* Hypervisor-specific bi-directional communication channel
Reported by FlawFinder.
Line: 76
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 vmmouse_data {
struct input_dev *abs_dev;
char phys[32];
char dev_name[128];
};
/*
* Hypervisor-specific bi-directional communication channel
* implementing the vmmouse protocol. Should never execute on
Reported by FlawFinder.
drivers/input/rmi4/rmi_f01.c
2 issues
Line: 51
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
bool has_lts;
bool has_adjustable_doze;
bool has_adjustable_doze_holdoff;
char dom[11]; /* YYYY/MM/DD + '\0' */
u8 product_id[RMI_PRODUCT_ID_LENGTH + 1];
u16 productinfo;
u32 firmware_id;
u32 package_id;
};
Reported by FlawFinder.
Line: 179
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
queries[6] & RMI_F01_QRY6_MONTH_MASK,
queries[7] & RMI_F01_QRY7_DAY_MASK);
memcpy(props->product_id, &queries[11],
RMI_PRODUCT_ID_LENGTH);
props->product_id[RMI_PRODUCT_ID_LENGTH] = '\0';
props->productinfo =
((queries[2] & RMI_F01_QRY2_PRODINFO_MASK) << 7) |
Reported by FlawFinder.
drivers/input/rmi4/rmi_f12.c
2 issues
Line: 213
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
valid_bytes = drvdata->attn_data.size;
else
valid_bytes = sensor->attn_size;
memcpy(sensor->data_pkt, drvdata->attn_data.data,
valid_bytes);
drvdata->attn_data.data += valid_bytes;
drvdata->attn_data.size -= valid_bytes;
} else {
retval = rmi_read_block(rmi_dev, f12->data_addr,
Reported by FlawFinder.
Line: 243
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 rmi_device *rmi_dev = fn->rmi_dev;
struct f12_data *f12 = dev_get_drvdata(&fn->dev);
int control_size;
char buf[3];
u16 control_offset = 0;
u8 subpacket_offset = 0;
if (f12->has_dribble
&& (f12->sensor.dribble != RMI_REG_STATE_DEFAULT)) {
Reported by FlawFinder.
drivers/input/rmi4/rmi_spi.c
2 issues
Line: 183
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
if (tx_buf)
memcpy(&rmi_spi->tx_buf[cmd_len], tx_buf, tx_len);
if (rmi_spi->tx_xfer_count > 1) {
for (i = 0; i < total_tx_len; i++) {
xfer = &rmi_spi->tx_xfers[i];
memset(xfer, 0, sizeof(struct spi_transfer));
Reported by FlawFinder.
Line: 234
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
if (rx_buf) {
memcpy(rx_buf, rmi_spi->rx_buf, rx_len);
rmi_dbg(RMI_DEBUG_XPORT, &spi->dev, "%s: (%d) %*ph\n",
__func__, rx_len, rx_len, rx_buf);
}
return 0;
Reported by FlawFinder.
drivers/input/serio/sa1111ps2.c
2 issues
Line: 49
Column: 16
CWE codes:
362
void __iomem *base;
int rx_irq;
int tx_irq;
unsigned int open;
spinlock_t lock;
unsigned int head;
unsigned int tail;
unsigned char buf[4];
};
Reported by FlawFinder.
Line: 53
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
spinlock_t lock;
unsigned int head;
unsigned int tail;
unsigned char buf[4];
};
/*
* Read all bytes waiting in the PS2 port. There should be
* at the most one, but we loop for safety. If there was a
Reported by FlawFinder.
drivers/input/tablet/aiptek.c
2 issues
Line: 269
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 odmCode; /* Tablet manufacturer code */
int modelCode; /* Tablet model code (not unique) */
int firmwareCode; /* prom/eeprom version */
char usbPath[64 + 1]; /* device's physical usb path */
};
struct aiptek_settings {
int pointerMode; /* stylus-, mouse-only or either */
int coordinateMode; /* absolute/relative coords */
Reported by FlawFinder.
Line: 1570
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
/* We do not care what you write to this file. Merely the action
* of writing to this file triggers a tablet reprogramming.
*/
memcpy(&aiptek->curSetting, &aiptek->newSetting,
sizeof(struct aiptek_settings));
if (aiptek_program_tablet(aiptek) < 0)
return -EIO;
Reported by FlawFinder.
drivers/input/tablet/hanwang.c
2 issues
Line: 59
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
const struct hanwang_features *features;
unsigned int current_tool;
unsigned int current_id;
char name[64];
char phys[32];
};
struct hanwang_features {
unsigned short pid;
Reported by FlawFinder.
Line: 60
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 current_tool;
unsigned int current_id;
char name[64];
char phys[32];
};
struct hanwang_features {
unsigned short pid;
char *name;
Reported by FlawFinder.
drivers/input/touchscreen/ad7879.c
2 issues
Line: 120
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
bool suspended; /* P: input->mutex */
bool swap_xy;
u16 conversion_data[AD7879_NR_SENSE];
char phys[32];
u8 first_conversion_delay;
u8 acquisition_time;
u8 averaging;
u8 pen_down_acc_interval;
u8 median;
Reported by FlawFinder.
Line: 363
Column: 9
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
{
struct ad7879 *ts = dev_get_drvdata(dev);
return sprintf(buf, "%u\n", ts->disabled);
}
static ssize_t ad7879_disable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
Reported by FlawFinder.
drivers/input/touchscreen/chipone_icn8505.c
2 issues
Line: 73
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 input_dev *input;
struct gpio_desc *wake_gpio;
struct touchscreen_properties prop;
char firmware_name[32];
};
static int icn8505_read_xfer(struct i2c_client *client, u16 i2c_addr,
int reg_addr, int reg_addr_width,
void *data, int len, bool silent)
Reported by FlawFinder.
Line: 131
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
for (i = 0; i < (reg_addr_width / 8); i++)
buf[i] = (reg_addr >> (reg_addr_width - (i + 1) * 8)) & 0xff;
memcpy(buf + reg_addr_width / 8, data, len);
ret = i2c_transfer(client->adapter, &msg, 1);
if (ret != 1) {
if (ret >= 0)
ret = -EIO;
Reported by FlawFinder.
drivers/input/touchscreen/dynapro.c
2 issues
Line: 54
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 input_dev *dev;
struct serio *serio;
int idx;
unsigned char data[DYNAPRO_FORMAT_LENGTH];
char phys[32];
};
static void dynapro_process_data(struct dynapro *pdynapro)
{
Reported by FlawFinder.
Line: 55
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 serio *serio;
int idx;
unsigned char data[DYNAPRO_FORMAT_LENGTH];
char phys[32];
};
static void dynapro_process_data(struct dynapro *pdynapro)
{
struct input_dev *dev = pdynapro->dev;
Reported by FlawFinder.