diff options
author | John Sonnenschein <johns@joyent.com> | 2012-05-17 18:26:57 +0000 |
---|---|---|
committer | John Sonnenschein <johns@joyent.com> | 2012-05-17 18:26:57 +0000 |
commit | 04b244dd661c24b510ac22936decfc0972d202d3 (patch) | |
tree | 3ebfef98afc303fddf3415d6fba64e8682f495e8 /usr/src/common/ucode/ucode_utils.c | |
parent | eac250589e41f1b705e1b7427b02b3379aac9f9e (diff) | |
parent | a69187741b83640a90dd8586195456dd50c016a8 (diff) | |
download | illumos-joyent-20120517.tar.gz |
Merge git.joyent.com:illumos-joyent20120517
Diffstat (limited to 'usr/src/common/ucode/ucode_utils.c')
-rw-r--r-- | usr/src/common/ucode/ucode_utils.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/usr/src/common/ucode/ucode_utils.c b/usr/src/common/ucode/ucode_utils.c index 5878f4a4af..7721c5c310 100644 --- a/usr/src/common/ucode/ucode_utils.c +++ b/usr/src/common/ucode/ucode_utils.c @@ -142,21 +142,14 @@ ucode_validate_amd(uint8_t *ucodep, int size) ptr = (uint32_t *)(((uint8_t *)ptr) + count); size -= count; - /* - * minimum valid size: - * - type and size fields (8 bytes) - * - patch header (64 bytes) - * - one patch triad (28 bytes) - */ - while (size >= 100) { + while (size > 8) { /* microcode patch */ size -= 4; if (*ptr++ != 1) return (EM_FILEFORMAT); size -= 4; - if (((count = *ptr++) > size) || - ((count - sizeof (ucode_header_amd_t)) % 28)) + if (((count = *ptr++) > size)) return (EM_FILEFORMAT); /* LINTED: pointer alignment */ |