The following issues were found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
2 issues
Line: 345
Column: 6
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* Measure the output. */
va_start(args, msg);
n = vsnprintf(NULL, 0, msg, args);
va_end(args);
if (n <= 0)
return;
Reported by FlawFinder.
Line: 358
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
char *buf = (char *)kvcalloc(total, sizeof(char), GFP_KERNEL);
if (buf) {
memcpy(buf, log_ctx->buf, log_ctx->pos);
kfree(log_ctx->buf);
log_ctx->buf = buf;
log_ctx->size = total;
}
Reported by FlawFinder.
drivers/gpu/drm/drm_gem.c
2 issues
Line: 394
Column: 18
CWE codes:
362
if (ret)
goto err_remove;
if (obj->funcs->open) {
ret = obj->funcs->open(obj, file_priv);
if (ret)
goto err_revoke;
}
Reported by FlawFinder.
Line: 395
Column: 21
CWE codes:
362
goto err_remove;
if (obj->funcs->open) {
ret = obj->funcs->open(obj, file_priv);
if (ret)
goto err_revoke;
}
*handlep = handle;
Reported by FlawFinder.
crypto/dh_helper.c
2 issues
Line: 19
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
if (!dst || size > end - dst)
return NULL;
memcpy(dst, src, size);
return dst + size;
}
static inline const u8 *dh_unpack_data(void *dst, const void *src, size_t size)
{
Reported by FlawFinder.
Line: 25
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static inline const u8 *dh_unpack_data(void *dst, const void *src, size_t size)
{
memcpy(dst, src, size);
return src + size;
}
static inline unsigned int dh_data_size(const struct dh *p)
{
Reported by FlawFinder.
drivers/acpi/acpica/utalloc.c
2 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
acpi_status acpi_ut_delete_caches(void)
{
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char buffer[7];
if (acpi_gbl_display_final_mem_stats) {
strcpy(buffer, "MEMORY");
(void)acpi_db_display_statistics(buffer);
}
Reported by FlawFinder.
Line: 189
Column: 3
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
char buffer[7];
if (acpi_gbl_display_final_mem_stats) {
strcpy(buffer, "MEMORY");
(void)acpi_db_display_statistics(buffer);
}
#endif
(void)acpi_os_delete_cache(acpi_gbl_namespace_cache);
Reported by FlawFinder.
drivers/auxdisplay/charlcd.c
2 issues
Line: 44
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
/* Current escape sequence and it's length or -1 if outside */
struct {
char buf[LCD_ESCAPE_LEN + 1];
int len;
} esc_seq;
unsigned long long drvdata[];
};
Reported by FlawFinder.
Line: 539
Column: 14
CWE codes:
126
static void charlcd_puts(struct charlcd *lcd, const char *s)
{
const char *tmp = s;
int count = strlen(s);
for (; count-- > 0; tmp++) {
if (((count + 1) & 0x1f) == 0)
cond_resched();
Reported by FlawFinder.
drivers/char/ps3flash.c
2 issues
Line: 143
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
userbuf += n;
}
if (kernelbuf) {
memcpy(kernelbuf, src, n);
kernelbuf += n;
}
mutex_unlock(&priv->mutex);
Reported by FlawFinder.
Line: 215
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
userbuf += n;
}
if (kernelbuf) {
memcpy(dst, kernelbuf, n);
kernelbuf += n;
}
priv->tag = sector;
priv->dirty = true;
Reported by FlawFinder.
crypto/pcbc.c
2 issues
Line: 53
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
u8 tmpbuf[MAX_CIPHER_BLOCKSIZE];
do {
memcpy(tmpbuf, src, bsize);
crypto_xor(iv, src, bsize);
crypto_cipher_encrypt_one(tfm, src, iv);
crypto_xor_cpy(iv, tmpbuf, src, bsize);
src += bsize;
Reported by FlawFinder.
Line: 120
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
u8 tmpbuf[MAX_CIPHER_BLOCKSIZE] __aligned(__alignof__(u32));
do {
memcpy(tmpbuf, src, bsize);
crypto_cipher_decrypt_one(tfm, src, src);
crypto_xor(src, iv, bsize);
crypto_xor_cpy(iv, src, tmpbuf, bsize);
src += bsize;
Reported by FlawFinder.
drivers/gpu/drm/amd/display/dc/core/dc_link.c
2 issues
Line: 866
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
prev_sink = link->local_sink;
if (prev_sink) {
dc_sink_retain(prev_sink);
memcpy(&prev_dpcd_caps, &link->dpcd_caps, sizeof(struct dpcd_caps));
}
link_disconnect_sink(link);
if (new_connection_type != dc_connection_none) {
pre_connection_type = link->type;
Reported by FlawFinder.
Line: 1588
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
if (bios->integrated_info)
memcpy(info, bios->integrated_info, sizeof(*info));
/* Look for channel mapping corresponding to connector and device tag */
for (i = 0; i < MAX_NUMBER_OF_EXT_DISPLAY_PATH; i++) {
struct external_display_path *path =
&info->ext_disp_conn_info.path[i];
Reported by FlawFinder.
drivers/char/hpet.c
2 issues
Line: 101
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 hd_flags;
unsigned int hd_irq;
unsigned int hd_hdwirq;
char hd_name[HPET_DEV_NAME];
};
struct hpets {
struct hpets *hp_next;
struct hpet __iomem *hp_hpet;
Reported by FlawFinder.
Line: 502
Column: 3
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
writel(isr, &hpet->hpet_isr);
}
sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
irq_flags = devp->hd_flags & HPET_SHARED_IRQ ? IRQF_SHARED : 0;
if (request_irq(irq, hpet_interrupt, irq_flags,
devp->hd_name, (void *)devp)) {
printk(KERN_ERR "hpet: IRQ %d is not free\n", irq);
irq = 0;
Reported by FlawFinder.
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c
2 issues
Line: 608
Column: 7
CWE codes:
126
/*get display name string length */
while (audio_info->display_name[strlen++] != '\0') {
if (strlen >=
MAX_HW_AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS)
break;
}
set_reg_field_value(value, strlen,
AZALIA_F0_CODEC_PIN_CONTROL_SINK_INFO1,
Reported by FlawFinder.
Line: 612
Column: 29
CWE codes:
126
MAX_HW_AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS)
break;
}
set_reg_field_value(value, strlen,
AZALIA_F0_CODEC_PIN_CONTROL_SINK_INFO1,
SINK_DESCRIPTION_LEN);
AZ_REG_WRITE(AZALIA_F0_CODEC_PIN_CONTROL_SINK_INFO1,
value);
Reported by FlawFinder.