The following issues were found

drivers/firmware/scpi_pm_domain.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 19 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 generic_pm_domain genpd;
	struct scpi_ops *ops;
	u32 domain;
	char name[30];
};

/*
 * These device power state values are not well-defined in the specification.
 * In case, different implementations use different values, we can make these

            

Reported by FlawFinder.

sprintf - Does not check for buffer overflows
Security

Line: 113 Column: 3 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              
		scpi_pd->domain = i;
		scpi_pd->ops = scpi_ops;
		sprintf(scpi_pd->name, "%pOFn.%d", np, i);
		scpi_pd->genpd.name = scpi_pd->name;
		scpi_pd->genpd.power_off = scpi_pd_power_off;
		scpi_pd->genpd.power_on = scpi_pd_power_on;

		/*

            

Reported by FlawFinder.

drivers/acpi/osi.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              #define OSI_STRING_ENTRIES_MAX	16

struct acpi_osi_entry {
	char string[OSI_STRING_LENGTH_MAX];
	bool enable;
};

static struct acpi_osi_config {
	u8		default_disabling;

            

Reported by FlawFinder.

strncpy - Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned]
Security

Line: 137 Column: 4 CWE codes: 120

              			break;
		} else if (osi->string[0] == '\0') {
			osi->enable = enable;
			strncpy(osi->string, str, OSI_STRING_LENGTH_MAX);
			break;
		}
	}
}


            

Reported by FlawFinder.

drivers/acpi/acpica/dbcmds.c
2 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

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

              			return;
		}

		strcpy(acpi_db_trace_method_name, method_arg);
	}

	if (!strcmp(enable_arg, "ENABLE") ||
	    !strcmp(enable_arg, "METHOD") || !strcmp(enable_arg, "OPCODE")) {
		if (!strcmp(enable_arg, "ENABLE")) {

            

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: 1108 Column: 21 CWE codes: 126

              		}

		acpi_db_trace_method_name =
		    ACPI_ALLOCATE(strlen(method_arg) + 1);
		if (!acpi_db_trace_method_name) {
			acpi_os_printf("Failed to allocate method name (%s)\n",
				       method_arg);
			return;
		}

            

Reported by FlawFinder.

drivers/crypto/gemini/sl3516-ce-rng.c
2 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 33 Column: 9 CWE codes: 120 20

              		return err;
	}

	while (read < max) {
		*data = readl(ce->base + IPSEC_RAND_NUM_REG);
		data++;
		read += 4;
	}


            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 41 Column: 9 CWE codes: 120 20

              
	pm_runtime_put(ce->dev);

	return read;
}

int sl3516_ce_rng_register(struct sl3516_ce_dev *ce)
{
	int ret;

            

Reported by FlawFinder.

drivers/clk/versatile/clk-sp810.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              static void __init clk_sp810_of_setup(struct device_node *node)
{
	struct clk_sp810 *sp810 = kzalloc(sizeof(*sp810), GFP_KERNEL);
	const char *parent_names[2];
	int num = ARRAY_SIZE(parent_names);
	char name[12];
	struct clk_init_data init;
	static int instance;
	int i;

            

Reported by FlawFinder.

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

Line: 87 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 clk_sp810 *sp810 = kzalloc(sizeof(*sp810), GFP_KERNEL);
	const char *parent_names[2];
	int num = ARRAY_SIZE(parent_names);
	char name[12];
	struct clk_init_data init;
	static int instance;
	int i;
	bool deprecated;


            

Reported by FlawFinder.

drivers/crypto/geode-aes.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              	tctx->keylen = len;

	if (len == AES_KEYSIZE_128) {
		memcpy(tctx->key, key, len);
		return 0;
	}

	if (len != AES_KEYSIZE_192 && len != AES_KEYSIZE_256)
		/* not supported at all */

            

Reported by FlawFinder.

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

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

              	tctx->keylen = len;

	if (len == AES_KEYSIZE_128) {
		memcpy(tctx->key, key, len);
		return 0;
	}

	if (len != AES_KEYSIZE_192 && len != AES_KEYSIZE_256)
		/* not supported at all */

            

Reported by FlawFinder.

drivers/acpi/nvs.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              				suspend_nvs_free();
				return -ENOMEM;
			}
			memcpy(entry->data, entry->kaddr, entry->size);
		}

	return 0;
}


            

Reported by FlawFinder.

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

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

              
	list_for_each_entry(entry, &nvs_list, node)
		if (entry->data)
			memcpy(entry->kaddr, entry->data, entry->size);
}
#endif

            

Reported by FlawFinder.

crypto/chacha_generic.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              	subctx.nrounds = ctx->nrounds;

	/* Build the real IV */
	memcpy(&real_iv[0], req->iv + 24, 8); /* stream position */
	memcpy(&real_iv[8], req->iv + 16, 8); /* remaining 64 nonce bits */

	/* Generate the stream and XOR it with the data */
	return chacha_stream_xor(req, &subctx, real_iv);
}

            

Reported by FlawFinder.

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

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

              
	/* Build the real IV */
	memcpy(&real_iv[0], req->iv + 24, 8); /* stream position */
	memcpy(&real_iv[8], req->iv + 16, 8); /* remaining 64 nonce bits */

	/* Generate the stream and XOR it with the data */
	return chacha_stream_xor(req, &subctx, real_iv);
}


            

Reported by FlawFinder.

drivers/acpi/acpi_pnp.c
2 issues
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: 322 Column: 6 CWE codes: 126

              {
	int i;

	if (strlen(idstr) != strlen(list_id))
		return false;

	if (memcmp(idstr, list_id, 3))
		return false;


            

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: 322 Column: 23 CWE codes: 126

              {
	int i;

	if (strlen(idstr) != strlen(list_id))
		return false;

	if (memcmp(idstr, list_id, 3))
		return false;


            

Reported by FlawFinder.

drivers/acpi/acpi_pad.c
2 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

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

              {
	acpi_status status;

	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

	if (acpi_pad_add_sysfs(device))
		return -ENODEV;


            

Reported by FlawFinder.

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

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

              	acpi_status status;

	strcpy(acpi_device_name(device), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
	strcpy(acpi_device_class(device), ACPI_PROCESSOR_AGGREGATOR_CLASS);

	if (acpi_pad_add_sysfs(device))
		return -ENODEV;

	status = acpi_install_notify_handler(device->handle,

            

Reported by FlawFinder.