aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitrii Merkurev <dimorinny@google.com>2024-02-12 12:53:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-02-12 12:53:16 +0000
commite25919d3a133b78691b7287db3f461db74be0562 (patch)
tree18a293e4e3a2b46ce3883bb56c37ef49dc1cee0f
parent844e5b694632edace623a09a32a1d4ee13dd0707 (diff)
parentd58779cb6425416074fce00f36066d76dc6d850b (diff)
downloadu-boot-e25919d3a133b78691b7287db3f461db74be0562.tar.gz
Merge "Disallow flashing locked device" into main
-rw-r--r--drivers/fastboot/fb_command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
index a4af564cfe..2f3e25ae3e 100644
--- a/drivers/fastboot/fb_command.c
+++ b/drivers/fastboot/fb_command.c
@@ -219,6 +219,9 @@ static void download(char *cmd_parameter, char *response)
{
char *tmp;
+ if (!ensure_device_is_unlocked("Download is not allowed on locked devices", response))
+ return;
+
if (!cmd_parameter) {
fastboot_fail("Expected command parameter", response);
return;
@@ -328,6 +331,9 @@ void fastboot_data_complete(char *response)
*/
static void __maybe_unused flash(char *cmd_parameter, char *response)
{
+ if (!ensure_device_is_unlocked("Flashing is not allowed on locked devices", response))
+ return;
+
if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK))
fastboot_block_flash_write(cmd_parameter, fastboot_buf_addr,
image_size, response);