aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugfs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debugfs')
-rw-r--r--lib/debugfs/dev.c6
-rw-r--r--lib/debugfs/devfip.c20
2 files changed, 17 insertions, 9 deletions
diff --git a/lib/debugfs/dev.c b/lib/debugfs/dev.c
index 0361437b8..2fc1d4062 100644
--- a/lib/debugfs/dev.c
+++ b/lib/debugfs/dev.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -333,6 +333,10 @@ noent:
******************************************************************************/
chan_t *clone(chan_t *c, chan_t *nc)
{
+ if (c->index == NODEV) {
+ return NULL;
+ }
+
return devtab[c->index]->clone(c, nc);
}
diff --git a/lib/debugfs/devfip.c b/lib/debugfs/devfip.c
index 5581b219f..85e6403c7 100644
--- a/lib/debugfs/devfip.c
+++ b/lib/debugfs/devfip.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -73,8 +73,11 @@ static const struct uuidnames uuidnames[] = {
{"soc-fw.cfg", UUID_SOC_FW_CONFIG},
{"tos-fw.cfg", UUID_TOS_FW_CONFIG},
{"nt-fw.cfg", UUID_NT_FW_CONFIG},
+ {"fw.cfg", UUID_FW_CONFIG},
{"rot-k.crt", UUID_ROT_KEY_CERT},
- {"nt-k.crt", UUID_NON_TRUSTED_WORLD_KEY_CERT}
+ {"nt-k.crt", UUID_NON_TRUSTED_WORLD_KEY_CERT},
+ {"sip-sp.crt", UUID_SIP_SECURE_PARTITION_CONTENT_CERT},
+ {"plat-sp.crt", UUID_PLAT_SECURE_PARTITION_CONTENT_CERT}
};
/*******************************************************************************
@@ -103,10 +106,6 @@ static int get_entry(chan_t *c, struct fip_entry *entry)
return -1;
}
- if ((entry->size > LONG_MAX) || (entry->offset_address > LONG_MAX)) {
- return -1;
- }
-
if (entry->size == 0) {
return 0;
}
@@ -130,7 +129,10 @@ static int fipgen(chan_t *c, const dirtab_t *tab, int ntab, int n, dir_t *dir)
panic();
}
- clone(archives[c->dev].c, &nc);
+ if (clone(archives[c->dev].c, &nc) == NULL) {
+ panic();
+ }
+
fip = &archives[nc.dev];
off = STOC_HEADER;
@@ -203,7 +205,9 @@ static int fipread(chan_t *c, void *buf, int n)
panic();
}
- clone(fip->c, &cs);
+ if (clone(fip->c, &cs) == NULL) {
+ panic();
+ }
size = fip->size[c->qid];
if (c->offset >= size) {