Skip to content

Commit

Permalink
kernel: deny unexpected offset value for signing check
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Mar 29, 2024
1 parent 869cd50 commit 97ee114
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/apk_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ static __always_inline bool check_v2_signature(char *path,
pr_info("Unknown singature block id: 0x%08x\n", id);
goto clean;
}
pos += (size8 - offset);
u64 next = size8 - offset;
if (next == 0) {
pr_warn("Unexpeced offset value!\n");
goto clean;
}
pos += next;
}

if (v2_signing_blocks != 1) {
Expand Down

0 comments on commit 97ee114

Please sign in to comment.