The following issues were found
arch/powerpc/include/asm/kvm_ppc.h
1 issues
Line: 806
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 kvmppc_host_rm_core {
union kvmppc_rm_state rm_state;
void *rm_data;
char pad[112];
};
struct kvmppc_host_rm_ops {
struct kvmppc_host_rm_core *rm_core;
void (*vcpu_kick)(struct kvm_vcpu *vcpu);
Reported by FlawFinder.
arch/powerpc/include/asm/kvm_book3s_64.h
1 issues
Line: 624
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
vcpu->arch.ppr_tm = vcpu->arch.ppr;
vcpu->arch.dscr_tm = vcpu->arch.dscr;
vcpu->arch.tar_tm = vcpu->arch.tar;
memcpy(vcpu->arch.gpr_tm, vcpu->arch.regs.gpr,
sizeof(vcpu->arch.regs.gpr));
vcpu->arch.fp_tm = vcpu->arch.fp;
vcpu->arch.vr_tm = vcpu->arch.vr;
vcpu->arch.vrsave_tm = vcpu->arch.vrsave;
}
Reported by FlawFinder.
arch/powerpc/platforms/cell/spufs/inode.c
1 issues
Line: 671
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return;
isolated_loader_size = size;
memcpy(isolated_loader, loader, size);
printk(KERN_INFO "spufs: SPU isolation mode enabled\n");
}
static int spufs_create_root(struct super_block *sb, struct fs_context *fc)
{
Reported by FlawFinder.
arch/powerpc/platforms/chrp/nvram.c
1 issues
Line: 19
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
#include "chrp.h"
static unsigned int nvram_size;
static unsigned char nvram_buf[4];
static DEFINE_SPINLOCK(nvram_lock);
static unsigned char chrp_nvram_read_val(int addr)
{
unsigned int done;
Reported by FlawFinder.
arch/powerpc/include/asm/kexec.h
1 issues
Line: 67
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
struct pt_regs *oldregs)
{
if (oldregs)
memcpy(newregs, oldregs, sizeof(*newregs));
else
ppc_save_regs(newregs);
}
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
Reported by FlawFinder.
arch/powerpc/platforms/embedded6xx/ls_uart.c
1 issues
Line: 32
Column: 12
CWE codes:
126
{
const char string[] = "AAAAFFFFJJJJ>>>>VVVV>>>>ZZZZVVVVKKKK";
int i = 0, rescue = 8;
int len = strlen(string);
while (rescue--) {
int j;
char lsr = in_8(avr_addr + UART_LSR);
Reported by FlawFinder.
arch/powerpc/platforms/microwatt/rng.c
1 issues
Line: 48
return -EIO;
}
machine_subsys_initcall(, rng_init);
Reported by Cppcheck.
arch/powerpc/include/asm/hvsi.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
struct tty_struct;
struct hvsi_priv {
unsigned int inbuf_len; /* data in input buffer */
unsigned char inbuf[HVSI_INBUF_SIZE];
unsigned int inbuf_cur; /* Cursor in input buffer */
unsigned int inbuf_pktlen; /* packet length from cursor */
atomic_t seqno; /* packet sequence number */
unsigned int opened:1; /* driver opened */
unsigned int established:1; /* protocol established */
Reported by FlawFinder.
arch/powerpc/platforms/powermac/backlight.c
1 issues
Line: 66
Column: 35
CWE codes:
126
if (bk_node) {
const char *prop = of_get_property(bk_node,
"backlight-control", NULL);
if (prop && strncmp(prop, type, strlen(type)) == 0) {
of_node_put(bk_node);
return 1;
}
of_node_put(bk_node);
}
Reported by FlawFinder.
arch/powerpc/include/asm/hvcserver.h
1 issues
Line: 35
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 list_head node;
uint32_t unit_address;
uint32_t partition_ID;
char location_code[HVCS_CLC_LENGTH + 1]; /* CLC + 1 null-term char */
};
extern int hvcs_free_partner_info(struct list_head *head);
extern int hvcs_get_partner_info(uint32_t unit_address,
struct list_head *head, unsigned long *pi_buff);
Reported by FlawFinder.