[PATCH] x86/setup: Annotate pci_setup_rom::romdata with __counted_by()

Thorsten Blum posted 1 patch 6 days, 10 hours ago
arch/x86/include/asm/setup_data.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/setup: Annotate pci_setup_rom::romdata with __counted_by()
Posted by Thorsten Blum 6 days, 10 hours ago
Add __counted_by() to pci_setup_rom::romdata to enable access bounds
checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/x86/include/asm/setup_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/setup_data.h b/arch/x86/include/asm/setup_data.h
index 7bb16f843c93..36ca725182f9 100644
--- a/arch/x86/include/asm/setup_data.h
+++ b/arch/x86/include/asm/setup_data.h
@@ -15,7 +15,7 @@ struct pci_setup_rom {
 	unsigned long bus;
 	unsigned long device;
 	unsigned long function;
-	uint8_t romdata[];
+	uint8_t romdata[] __counted_by(pcilen);
 };
 
 /* kexec external ABI */