diff options
| author | Xiang Wang <[email protected]> | 2019-03-06 15:29:34 +0800 |
|---|---|---|
| committer | Atish Patra <[email protected]> | 2019-03-06 11:10:35 -0800 |
| commit | 9eb8f0f90d5c873576d18d405bbd932ad9688741 (patch) | |
| tree | b1e5b974fe6d35fef9b141c955ba8ddad43cdf87 /platform | |
| parent | 27fae182dc54e08314034a03eeb583b94c64f4c8 (diff) | |
platform: Make the `platform` read-only
platform should be a read-only variable, if it is placed in the data
segment, it may be exploited.
Signed-off-by: Xiang Wang <[email protected]>
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/kendryte/k210/platform.c | 2 | ||||
| -rw-r--r-- | platform/qemu/sifive_u/platform.c | 2 | ||||
| -rw-r--r-- | platform/qemu/virt/platform.c | 2 | ||||
| -rw-r--r-- | platform/sifive/fu540/platform.c | 2 | ||||
| -rw-r--r-- | platform/template/platform.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c index 104edccb..cba83dae 100644 --- a/platform/kendryte/k210/platform.c +++ b/platform/kendryte/k210/platform.c @@ -98,7 +98,7 @@ static int k210_system_shutdown(u32 type) return 0; } -struct sbi_platform platform = { +const struct sbi_platform platform = { .name = "Kendryte K210", .features = SBI_PLATFORM_HAS_TIMER_VALUE, diff --git a/platform/qemu/sifive_u/platform.c b/platform/qemu/sifive_u/platform.c index e8542f2e..cc8993d9 100644 --- a/platform/qemu/sifive_u/platform.c +++ b/platform/qemu/sifive_u/platform.c @@ -125,7 +125,7 @@ static int sifive_u_system_down(u32 type) return 0; } -struct sbi_platform platform = { +const struct sbi_platform platform = { .name = "QEMU SiFive Unleashed", .features = SBI_PLATFORM_DEFAULT_FEATURES, .hart_count = SIFIVE_U_HART_COUNT, diff --git a/platform/qemu/virt/platform.c b/platform/qemu/virt/platform.c index ab40b939..fd4d8299 100644 --- a/platform/qemu/virt/platform.c +++ b/platform/qemu/virt/platform.c @@ -134,7 +134,7 @@ static int virt_system_down(u32 type) return 0; } -struct sbi_platform platform = { +const struct sbi_platform platform = { .name = "QEMU Virt Machine", .features = SBI_PLATFORM_DEFAULT_FEATURES, .hart_count = VIRT_HART_COUNT, diff --git a/platform/sifive/fu540/platform.c b/platform/sifive/fu540/platform.c index a244d10f..c14275ab 100644 --- a/platform/sifive/fu540/platform.c +++ b/platform/sifive/fu540/platform.c @@ -187,7 +187,7 @@ static int fu540_system_down(u32 type) return 0; } -struct sbi_platform platform = { +const struct sbi_platform platform = { .name = "SiFive Freedom U540", .features = SBI_PLATFORM_DEFAULT_FEATURES, .hart_count = FU540_HART_COUNT, diff --git a/platform/template/platform.c b/platform/template/platform.c index c14398f8..866d2734 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -207,7 +207,7 @@ static int platform_system_shutdown(u32 type) /* * Platform descriptor. */ -struct sbi_platform platform = { +const struct sbi_platform platform = { .name = "platform-name", .features = SBI_PLATFORM_DEFAULT_FEATURES, |
