The following issues were found
arch/powerpc/boot/treeboot-akebono.c
1 issues
Line: 103
Column: 17
CWE codes:
126
char *end;
userdata[USERDATA_LEN - 1] = '\0';
userdata_len = strlen(userdata);
for (i = 0; i < userdata_len - 15; i++) {
if (strncmp(&userdata[i], "local-mac-addr=", 15) == 0) {
if (i > 0 && userdata[i - 1] != ' ') {
/* We've only found a substring ending
* with local-mac-addr so this isn't
Reported by FlawFinder.
arch/powerpc/boot/simple_alloc.c
1 issues
Line: 117
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return ptr;
new = simple_malloc(size);
memcpy(new, ptr, p->size);
simple_free(ptr);
return new;
}
/*
Reported by FlawFinder.
arch/powerpc/boot/redboot-8xx.c
1 issues
Line: 54
Column: 28
CWE codes:
126
platform_ops.fixups = platform_fixups;
loader_info.cmdline = (char *)bd.bi_cmdline;
loader_info.cmdline_len = strlen((char *)bd.bi_cmdline);
}
Reported by FlawFinder.
arch/powerpc/boot/redboot-83xx.c
1 issues
Line: 56
Column: 28
CWE codes:
126
platform_ops.fixups = platform_fixups;
loader_info.cmdline = (char *)bd.bi_cmdline;
loader_info.cmdline_len = strlen((char *)bd.bi_cmdline);
}
Reported by FlawFinder.
arch/powerpc/platforms/powernv/opal-hmi.c
1 issues
Line: 350
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
pr_err("HMI: out of memory, Opal message event not handled\n");
return -ENOMEM;
}
memcpy(&msg_node->hmi_evt, hmi_evt, sizeof(*hmi_evt));
spin_lock_irqsave(&opal_hmi_evt_lock, flags);
list_add(&msg_node->list, &opal_hmi_evt_list);
spin_unlock_irqrestore(&opal_hmi_evt_lock, flags);
Reported by FlawFinder.
arch/powerpc/boot/oflib.c
1 issues
Line: 116
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
static int check_of_version(void)
{
phandle oprom, chosen;
char version[64];
oprom = of_finddevice("/openprom");
if (oprom == (phandle) -1)
return 0;
if (of_getprop(oprom, "model", version, sizeof(version)) <= 0)
Reported by FlawFinder.
arch/powerpc/platforms/powernv/opal-irqchip.c
1 issues
Line: 276
Column: 18
CWE codes:
126
const char *name;
/* Prefix name */
if (r->name && strlen(r->name))
name = kasprintf(GFP_KERNEL, "opal-%s", r->name);
else
name = kasprintf(GFP_KERNEL, "opal");
/* Install interrupt handler */
Reported by FlawFinder.
arch/x86/kvm/xen.c
1 issues
Line: 643
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
else if (!xhc->msr && kvm->arch.xen_hvm_config.msr)
static_branch_slow_dec_deferred(&kvm_xen_enabled);
memcpy(&kvm->arch.xen_hvm_config, xhc, sizeof(*xhc));
mutex_unlock(&kvm->lock);
return 0;
}
Reported by FlawFinder.
arch/powerpc/platforms/powernv/opal-prd.c
1 issues
Line: 355
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!item)
return -ENOMEM;
memcpy(&item->msg, msg->params, msg_size);
spin_lock_irqsave(&opal_prd_msg_queue_lock, flags);
list_add_tail(&item->list, &opal_prd_msg_queue);
spin_unlock_irqrestore(&opal_prd_msg_queue_lock, flags);
Reported by FlawFinder.
arch/x86/lib/copy_mc.c
1 issues
Line: 68
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return copy_mc_fragile(dst, src, len);
if (static_cpu_has(X86_FEATURE_ERMS))
return copy_mc_enhanced_fast_string(dst, src, len);
memcpy(dst, src, len);
return 0;
}
EXPORT_SYMBOL_GPL(copy_mc_to_kernel);
unsigned long __must_check copy_mc_to_user(void *dst, const void *src, unsigned len)
Reported by FlawFinder.