generic: deny write to uImage.FIT sub-image partitions
[openwrt/staging/chunkeey.git] / target / linux / generic / files / block / partitions / fit.c
index a0aa0eadf537545c88b89734f5ea78b800d6939b..fa73e64af81e1fdcf901d891f8fddb0f42972e79 100644 (file)
@@ -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;