The following issues were found
drivers/tty/serial/mcf.c
1 issues
Line: 625
Column: 14
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
port->type = PORT_MCF;
port->mapbase = platp[i].mapbase;
port->membase = (platp[i].membase) ? platp[i].membase :
(unsigned char __iomem *) platp[i].mapbase;
port->dev = &pdev->dev;
port->iotype = SERIAL_IO_MEM;
port->irq = platp[i].irq;
port->uartclk = MCF_BUSCLK;
port->ops = &mcf_uart_ops;
Reported by FlawFinder.
drivers/tty/serial/mxs-auart.c
1 issues
Line: 586
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
CIRC_CNT_TO_END(xmit->head,
xmit->tail,
UART_XMIT_SIZE));
memcpy(buffer + i, xmit->buf + xmit->tail, size);
xmit->tail = (xmit->tail + size) & (UART_XMIT_SIZE - 1);
i += size;
if (i >= UART_XMIT_SIZE)
break;
Reported by FlawFinder.
drivers/tty/serial/pmac_zilog.h
1 issues
Line: 65
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
volatile struct dbdma_regs __iomem *rx_dma_regs;
#endif
unsigned char irq_name[8];
struct ktermios termios_cache;
};
#define to_pmz(p) ((struct uart_pmac_port *)(p))
Reported by FlawFinder.
drivers/tty/serial/pxa.c
1 issues
Line: 48
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 char mcr;
unsigned int lsr_break_flag;
struct clk *clk;
char name[PXA_NAME_LEN];
};
static inline unsigned int serial_in(struct uart_pxa_port *up, int offset)
{
offset <<= 2;
Reported by FlawFinder.
drivers/tty/serial/qcom_geni_serial.c
1 issues
Line: 529
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
static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop)
{
u32 i;
unsigned char buf[sizeof(u32)];
struct tty_port *tport;
struct qcom_geni_serial_port *port = to_dev_port(uport, uport);
tport = &uport->state->port;
for (i = 0; i < bytes; ) {
Reported by FlawFinder.
drivers/soc/fsl/dpaa2-console.c
1 issues
Line: 45
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 log_header {
__le32 magic_word;
char reserved[4];
__le32 buf_start;
__le32 buf_length;
__le32 last_byte;
};
Reported by FlawFinder.
drivers/tty/serial/sprd_serial.c
1 issues
Line: 123
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 sprd_uart_port {
struct uart_port port;
char name[16];
struct clk *clk;
struct sprd_uart_dma tx_dma;
struct sprd_uart_dma rx_dma;
dma_addr_t pos;
unsigned char *rx_buf_tail;
Reported by FlawFinder.
drivers/tty/serial/sunzilog.c
1 issues
Line: 77
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 uart_sunzilog_port *next;
/* Current values of Zilog write registers. */
unsigned char curregs[NUM_ZSREGS];
unsigned int flags;
#define SUNZILOG_FLAG_CONS_KEYB 0x00000001
#define SUNZILOG_FLAG_CONS_MOUSE 0x00000002
#define SUNZILOG_FLAG_IS_CONS 0x00000004
Reported by FlawFinder.
drivers/tty/serial/tegra-tcu.c
1 issues
Line: 200
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
#if IS_ENABLED(CONFIG_SERIAL_TEGRA_TCU_CONSOLE)
/* setup the console */
strcpy(tcu->console.name, "ttyTCU");
tcu->console.device = uart_console_device;
tcu->console.flags = CON_PRINTBUFFER | CON_ANYTIME;
tcu->console.index = -1;
tcu->console.write = tegra_tcu_console_write;
tcu->console.setup = tegra_tcu_console_setup;
Reported by FlawFinder.
drivers/tty/serial/vt8500_serial.c
1 issues
Line: 97
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 vt8500_port {
struct uart_port uart;
char name[16];
struct clk *clk;
unsigned int clk_predivisor;
unsigned int ier;
unsigned int vt8500_uart_flags;
};
Reported by FlawFinder.