The following issues were found

arch/m68k/include/asm/dma.h
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 148 Column: 21 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

              #endif

  dmawp = (unsigned short *) dma_base_addr[dmanr];
  dmapb = (unsigned char *) dma_base_addr[dmanr];

  /* Turn off external requests, and stop any DMA in progress */
  dmawp[MCFDMA_DCR] &= ~MCFDMA_DCR_EEXT;
  dmapb[MCFDMA_DSR] = MCFDMA_DSR_DONE;
}

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 180 Column: 21 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

                printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
#endif

  dmabp = (unsigned char *) dma_base_addr[dmanr];
  dmawp = (unsigned short *) dma_base_addr[dmanr];

  /* Clear config errors */
  dmabp[MCFDMA_DSR] = MCFDMA_DSR_DONE;


            

Reported by FlawFinder.

arch/m68k/include/asm/nubus.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 17 Column: 36 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              #define nubus_writel raw_outl

#define nubus_memset_io(a,b,c)		memset((void *)(a),(b),(c))
#define nubus_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
#define nubus_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))

static inline void *nubus_remap_nocache_ser(unsigned long physaddr,
					    unsigned long size)
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 18 Column: 34 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
#define nubus_memset_io(a,b,c)		memset((void *)(a),(b),(c))
#define nubus_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
#define nubus_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))

static inline void *nubus_remap_nocache_ser(unsigned long physaddr,
					    unsigned long size)
{
	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);

            

Reported by FlawFinder.

arch/m68k/include/asm/zorro.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 17 Column: 32 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              #define z_writel raw_outl

#define z_memset_io(a,b,c)	memset((void *)(a),(b),(c))
#define z_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
#define z_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))

static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr,
					unsigned long size)
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 18 Column: 30 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
#define z_memset_io(a,b,c)	memset((void *)(a),(b),(c))
#define z_memcpy_fromio(a,b,c)	memcpy((a),(void *)(b),(c))
#define z_memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))

static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr,
					unsigned long size)
{
	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);

            

Reported by FlawFinder.

arch/m68k/include/uapi/asm/bootinfo-vme.h
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 49 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

               */

typedef struct {
	char	bdid[4];
	__u8	rev, mth, day, yr;
	__be16	size, reserved;
	__be16	brdno;
	char	brdsuffix[2];
	__be32	options;

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 53 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

              	__u8	rev, mth, day, yr;
	__be16	size, reserved;
	__be16	brdno;
	char	brdsuffix[2];
	__be32	options;
	__be16	clun, dlun, ctype, dnum;
	__be32	option2;
} t_bdid, *p_bdid;


            

Reported by FlawFinder.

arch/m68k/include/uapi/asm/stat.h
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 47 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 stat64 {
	unsigned long long	st_dev;
	unsigned char	__pad1[2];

#define STAT64_HAS_BROKEN_ST_INO	1
	unsigned long	__st_ino;

	unsigned int	st_mode;

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 59 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

              	unsigned long	st_gid;

	unsigned long long	st_rdev;
	unsigned char	__pad3[2];

	long long	st_size;
	unsigned long	st_blksize;

	unsigned long long	st_blocks;	/* Number 512-byte blocks allocated. */

            

Reported by FlawFinder.

arch/m68k/kernel/bootinfo_proc.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 17 Column: 8 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 <asm/byteorder.h>


static char bootinfo_tmp[1536] __initdata;

static void *bootinfo_copy;
static size_t bootinfo_size;

static ssize_t bootinfo_read(struct file *file, char __user *buf,

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 51 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	}

	pr_info("Saving %zu bytes of bootinfo\n", size);
	memcpy(bootinfo_tmp, start, size);
	bootinfo_size = size;
}

static int __init init_bootinfo_procfs(void)
{

            

Reported by FlawFinder.

arch/m68k/lib/memcpy.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 10 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              #include <linux/module.h>
#include <linux/string.h>

void *memcpy(void *to, const void *from, size_t n)
{
	void *xto = to;
	size_t temp;

	if (!n)

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 89 Column: 15 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              	}
	return xto;
}
EXPORT_SYMBOL(memcpy);

            

Reported by FlawFinder.

arch/m68k/mac/config.c
2 issues
strcat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 877 Column: 2 CWE codes: 120
Suggestion: Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused)

              static void mac_get_model(char *str)
{
	strcpy(str, "Macintosh ");
	strcat(str, macintosh_config->name);
}

static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
	{
		.flags = IORESOURCE_IRQ,

            

Reported by FlawFinder.

strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 876 Column: 2 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

              
static void mac_get_model(char *str)
{
	strcpy(str, "Macintosh ");
	strcat(str, macintosh_config->name);
}

static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
	{

            

Reported by FlawFinder.

arch/m68k/q40/config.c
2 issues
sprintf - Does not check for buffer overflows
Security

Line: 146 Column: 2 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              
static void q40_get_model(char *model)
{
	sprintf(model, "Q40");
}

static unsigned int serports[] =
{
	0x3f8,0x2f8,0x3e8,0x2e8,0

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 96 Column: 10 CWE codes: 126

              #if 0
void printq40(char *str)
{
	int l = strlen(str);
	char *p = q40_mem_cptr;

	while (l-- > 0 && _cpleft-- > 0) {
		*p = *str++;
		p += 4;

            

Reported by FlawFinder.

arch/m68k/sun3/idprom.c
2 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 92 Column: 11 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

              
	for (i = 0; i < NUM_SUN_MACHINES; i++) {
		if(Sun_Machines[i].id_machtype == idprom->id_machtype) {
		        strcpy(model, Sun_Machines[i].name);
			return;
		}
	}
}


            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 71 Column: 5 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

              				pr_info("TYPE: %s\n", Sun_Machines[i].name);
			else {
#if 0
				char sysname[128];

				prom_getproperty(prom_root_node, "banner-name",
						 sysname, sizeof(sysname));
				pr_info("TYPE: %s\n", sysname);
#endif

            

Reported by FlawFinder.