ANDROID: dm: android-verity: Remove fec_header location constraint
authorBadhri Jagan Sridharan <Badhri@google.com>
Tue, 27 Sep 2016 20:48:29 +0000 (13:48 -0700)
committerBadhri Jagan Sridharan <Badhri@google.com>
Tue, 27 Sep 2016 22:07:42 +0000 (15:07 -0700)
This CL removes the mandate of the fec_header being located right
after the ECC data.

(Cherry-picked from https://android-review.googlesource.com/#/c/280401)

Bug: 28865197
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Change-Id: Ie04c8cf2dd755f54d02dbdc4e734a13d6f6507b5

drivers/md/dm-android-verity.c

index 15ce2a81c1f4121e92f56d348781f442bf7e0caf..bb6c1285e499b466b3d5d2b216eb52e3c50f3965 100644 (file)
@@ -266,10 +266,7 @@ static inline int validate_fec_header(struct fec_header *header, u64 offset)
                le32_to_cpu(header->version) != FEC_VERSION ||
                le32_to_cpu(header->size) != sizeof(struct fec_header) ||
                le32_to_cpu(header->roots) == 0 ||
-               le32_to_cpu(header->roots) >= FEC_RSM ||
-               offset < le32_to_cpu(header->fec_size) ||
-               offset - le32_to_cpu(header->fec_size) !=
-               le64_to_cpu(header->inp_size))
+               le32_to_cpu(header->roots) >= FEC_RSM)
                return -EINVAL;
 
        return 0;