kernel: deny unexpected offset value for signing check

This commit is contained in:
weishu
2024-03-29 14:28:51 +08:00
parent 869cd50b79
commit 97ee114aa5

View File

@@ -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) {