This is an automated email from Gerrit.

Marc Schink ([email protected]) just uploaded a new patch set to Gerrit, which you 
can find at http://openocd.zylin.com/5425

-- gerrit

commit 7b33347c38f7b3f5af4debf15936d9bfd993ae50
Author: Marc Schink <[email protected]>
Date:   Mon Jan 20 17:41:59 2020 +0100

    flash/nor/stm32f1x: Add warning about vulnerable RDP in F1 series
    
    For further details, see:
    https://blog.zapb.de/stm32f1-announcement/
    
    Change-Id: I6a3a64e27e8e76a5a817db27603cc1b0c10233b1
    Signed-off-by: Marc Schink <[email protected]>

diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 7d5a8f0..31cec86 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -126,6 +126,7 @@ struct stm32x_flash_bank {
        int user_data_offset;
        int option_offset;
        uint32_t user_bank_size;
+       bool rdp_vulnerable;
 };
 
 static int stm32x_mass_erase(struct flash_bank *bank);
@@ -700,6 +701,7 @@ static int stm32x_probe(struct flash_bank *bank)
        stm32x_info->register_base = FLASH_REG_BASE_B0;
        stm32x_info->user_data_offset = 10;
        stm32x_info->option_offset = 0;
+       stm32x_info->rdp_vulnerable = false;
 
        /* default factory read protection level 0 */
        stm32x_info->default_rdp = 0xA5;
@@ -738,37 +740,44 @@ static int stm32x_probe(struct flash_bank *bank)
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x412: /* stm32f1x low-density */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 32;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x414: /* stm32f1x high-density */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 512;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x418: /* stm32f1x connectivity */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 256;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x430: /* stm32f1 XL-density (dual flash banks) */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 1024;
                stm32x_info->has_dual_banks = true;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x420: /* stm32f100xx low- and medium-density value line */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x428: /* stm32f100xx high-density value line */
                page_size = 2048;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
+               stm32x_info->rdp_vulnerable = true;
                break;
        case 0x422: /* stm32f302/3xb/c */
                page_size = 2048;
@@ -1183,6 +1192,11 @@ COMMAND_HANDLER(stm32x_handle_lock_command)
                return ERROR_OK;
        }
 
+       if (stm32x_info->rdp_vulnerable) {
+               command_print(CMD, "Warning: due to a vulnerability, your 
firmware "
+                       "might not be entirely protected (CVE-2020-8004)");
+       }
+
        command_print(CMD, "stm32x locked");
 
        return ERROR_OK;

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to