From 8b556a9435301918d75c1d755df741eea18c30a1 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 21 Aug 2020 14:55:23 +0200 Subject: [PATCH] usb_block: fix upper block-number range check The driver wrongly rejected a block request for the very last block of the device, which prevented part_block from successfully parsing the partition table (when attempting to access the GPT backup). Fixes #3861 --- repos/os/src/drivers/usb_block/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/src/drivers/usb_block/main.cc b/repos/os/src/drivers/usb_block/main.cc index eb068f5d39..578a5015e5 100644 --- a/repos/os/src/drivers/usb_block/main.cc +++ b/repos/os/src/drivers/usb_block/main.cc @@ -852,7 +852,7 @@ struct Usb::Block_driver : Usb::Completion /* range check */ block_number_t const last = op.block_number + op.count; - if (last >= info().block_count) + if (last > info().block_count) return Response::REJECTED; /* check if request is pending */