paycheck: Check MOVE operations for start block 0.

paycheck now blocks payloads that read or write to block 0 in a MOVE
operation. It must do this because old versions of PReadAll and
PWriteAll could not seek to 0.

BUG=chromium:480751
TEST=unit tests, test_paycheck.sh

Change-Id: I042de444c92896496795af235e9386dca6c77be2
Reviewed-on: https://chromium-review.googlesource.com/267088
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Allie Wood <alliewood@chromium.org>
Trybot-Ready: Allie Wood <alliewood@chromium.org>
Tested-by: Allie Wood <alliewood@chromium.org>
diff --git a/scripts/update_payload/checker.py b/scripts/update_payload/checker.py
index 48b18e6..f2aa7bb 100644
--- a/scripts/update_payload/checker.py
+++ b/scripts/update_payload/checker.py
@@ -778,6 +778,14 @@
         dst_idx = dst_extent.start_block
         dst_num = dst_extent.num_blocks
 
+      # Check: start block is not 0. See crbug/480751; there are still versions
+      # of update_engine which fail when seeking to 0 in PReadAll and PWriteAll,
+      # so we need to fail payloads that try to MOVE to/from block 0.
+      if src_idx == 0 or dst_idx == 0:
+        raise error.PayloadError(
+            '%s: MOVE operation cannot have extent with start block 0' %
+            op_name)
+
       if self.check_move_same_src_dst_block and src_idx == dst_idx:
         raise error.PayloadError(
             '%s: src/dst block number %d is the same (%d).' %