From 1473f6ac882fde8078826ca828aa3494ff98bf08 Mon Sep 17 00:00:00 2001 From: Prasanthi Chellakumar Date: Tue, 9 Oct 2018 11:46:40 -0700 Subject: arm: at91: wdt: Convert watchdog driver to dm/dt Convert the Watchdog driver for AT91SAM9x processors to support the driver model and device tree. Changes "CONFIG_AT91SAM9_WATCHDOG" to new "CONFIG_WDT_AT91" Kconfig option. Signed-off-by: Prasanthi Chellakumar --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index 96503ff8d3c..f1a1432d869 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -91,7 +91,7 @@ static int init_func_watchdog_init(void) { # if defined(CONFIG_HW_WATCHDOG) && \ (defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \ - defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \ + defined(CONFIG_SH) || \ defined(CONFIG_DESIGNWARE_WATCHDOG) || \ defined(CONFIG_IMX_WATCHDOG)) hw_watchdog_init(); -- cgit v1.3.1 From f1c85688ab13f154ebe1b1480def233a22e7f66b Mon Sep 17 00:00:00 2001 From: Konrad Beckmann Date: Wed, 7 Nov 2018 14:51:45 -0500 Subject: image-sig: Ensure that hashed-nodes is null-terminated A specially crafted FIT image leads to memory corruption in the stack when using the verified boot feature. The function fit_config_check_sig has a logic error that makes it possible to write past the end of the stack allocated array node_inc. This could potentially be used to bypass the signature check when using verified boot. This change ensures that the number of strings is correct when counted. Signed-off-by: Konrad Beckmann Reviewed-by: Simon Glass --- common/image-sig.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/image-sig.c b/common/image-sig.c index 5a269d3289b..5d860e12663 100644 --- a/common/image-sig.c +++ b/common/image-sig.c @@ -334,6 +334,11 @@ int fit_config_check_sig(const void *fit, int noffset, int required_keynode, return -1; } + if (prop && prop_len > 0 && prop[prop_len - 1] != '\0') { + *err_msgp = "hashed-nodes property must be null-terminated"; + return -1; + } + /* Add a sanity check here since we are using the stack */ if (count > IMAGE_MAX_HASHED_NODES) { *err_msgp = "Number of hashed nodes exceeds maximum"; -- cgit v1.3.1