[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240904014636.2033138-1-lihongbo22@huawei.com>
Date: Wed, 4 Sep 2024 09:46:36 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: <adrian.hunter@...el.com>, <ulf.hansson@...aro.org>, <kees@...nel.org>,
<gustavoars@...nel.org>
CC: <linux-mmc@...r.kernel.org>, <linux-hardening@...r.kernel.org>,
<lihongbo22@...wei.com>
Subject: [PATCH -next] mmc: sdhci-cadence: Annotate struct sdhci_cdns_phy_param with __counted_by()
Add the __counted_by compiler attribute to the flexible array member
entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
---
drivers/mmc/host/sdhci-cadence.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index be1505e8c536..2690bcaeaad5 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -73,7 +73,7 @@ struct sdhci_cdns_priv {
void (*priv_writel)(struct sdhci_cdns_priv *priv, u32 val, void __iomem *reg);
struct reset_control *rst_hw;
unsigned int nr_phy_params;
- struct sdhci_cdns_phy_param phy_params[];
+ struct sdhci_cdns_phy_param phy_params[] __counted_by(count);
};
struct sdhci_cdns_phy_cfg {
--
2.34.1
Powered by blists - more mailing lists