aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/block
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-01-11 00:00:36 +0000
committerDaniel Golle <daniel@makrotopia.org>2022-01-11 00:06:16 +0000
commitf2c3875dfcbf82d993ebe20f9563125c5fde2c60 (patch)
treea5e0bef99224f2bd994de33376e206d48b97d9ea /target/linux/generic/files/block
parent8cdc356f8c30b55698d5f57abbd1f3e16d8c653e (diff)
downloadupstream-f2c3875dfcbf82d993ebe20f9563125c5fde2c60.tar.gz
upstream-f2c3875dfcbf82d993ebe20f9563125c5fde2c60.tar.bz2
upstream-f2c3875dfcbf82d993ebe20f9563125c5fde2c60.zip
generic: deny write to uImage.FIT sub-image partitions
Set policy bit to force read-only mode on uImage.FIT filesystem sub-images mapped as block partitions by the FIT partition parser. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/files/block')
-rw-r--r--target/linux/generic/files/block/partitions/fit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/generic/files/block/partitions/fit.c b/target/linux/generic/files/block/partitions/fit.c
index a0aa0eadf5..fa73e64af8 100644
--- a/target/linux/generic/files/block/partitions/fit.c
+++ b/target/linux/generic/files/block/partitions/fit.c
@@ -230,7 +230,7 @@ int parse_fit_partitions(struct parsed_partitions *state, u64 fit_start_sector,
strlcat(state->pp_buf, tmp, PAGE_SIZE);
state->parts[*slot].has_info = true;
-
+ state->parts[*slot].flags |= ADDPART_FLAG_READONLY;
if (config_loadables && !strcmp(image_name, config_loadables)) {
printk(KERN_DEBUG "FIT: selecting configured loadable \"%s\" to be root filesystem\n", image_name);
state->parts[*slot].flags |= ADDPART_FLAG_ROOTDEV;