Skip to contentSkip to conversation

platform/x86/intel/vsec: Annotate deps with __counted_by_ptr()

PATCH RESEND New Thorsten Blum 1 participant 1 message Nov 13 Intel vendor specific extended capabilities driver

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 platform/x86/intel/vsec: Annotate deps with __counted_by_ptr()

Add __counted_by_ptr() to intel_vsec_platform_info::deps to enable access bounds checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

---
 include/linux/intel_vsec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/intel_vsec.h +1 -1
index 8686e79c4f75..6471823dc3a3 100644
@@ -134,7 +134,7 @@ struct vsec_feature_dependency {
 struct intel_vsec_platform_info {
 	struct device *parent;
 	struct intel_vsec_header **headers;
-	const struct vsec_feature_dependency *deps;
+	const struct vsec_feature_dependency *deps __counted_by_ptr(num_deps);
 	u32 (*acpi_disc)[PMT_DISC_DWORDS];
 	enum intel_vsec_disc_source src;
 	void *priv_data;