diff options
| -rw-r--r-- | arch/arc/kernel/unwind.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index cf2828ab0905..9f9ecc15556e 100644 --- a/arch/arc/kernel/unwind.c +++ b/arch/arc/kernel/unwind.c | |||
| @@ -293,13 +293,13 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
| 293 | const u32 *cie = cie_for_fde(fde, table); | 293 | const u32 *cie = cie_for_fde(fde, table); |
| 294 | signed ptrType; | 294 | signed ptrType; |
| 295 | 295 | ||
| 296 | if (cie == ¬_fde) /* only process FDE here */ | 296 | if (cie == ¬_fde) |
| 297 | continue; | 297 | continue; |
| 298 | if (cie == NULL || cie == &bad_cie) | 298 | if (cie == NULL || cie == &bad_cie) |
| 299 | continue; /* say FDE->CIE.version != 1 */ | 299 | return; |
| 300 | ptrType = fde_pointer_type(cie); | 300 | ptrType = fde_pointer_type(cie); |
| 301 | if (ptrType < 0) | 301 | if (ptrType < 0) |
| 302 | continue; | 302 | return; |
| 303 | 303 | ||
| 304 | ptr = (const u8 *)(fde + 2); | 304 | ptr = (const u8 *)(fde + 2); |
| 305 | if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde, | 305 | if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde, |
| @@ -343,10 +343,6 @@ static void init_unwind_hdr(struct unwind_table *table, | |||
| 343 | 343 | ||
| 344 | if (fde[1] == 0xffffffff) | 344 | if (fde[1] == 0xffffffff) |
| 345 | continue; /* this is a CIE */ | 345 | continue; /* this is a CIE */ |
| 346 | |||
| 347 | if (*(u8 *)(cie + 2) != 1) | ||
| 348 | continue; /* FDE->CIE.version not supported */ | ||
| 349 | |||
| 350 | ptr = (const u8 *)(fde + 2); | 346 | ptr = (const u8 *)(fde + 2); |
| 351 | header->table[n].start = read_pointer(&ptr, | 347 | header->table[n].start = read_pointer(&ptr, |
| 352 | (const u8 *)(fde + 1) + | 348 | (const u8 *)(fde + 1) + |
| @@ -523,8 +519,7 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table) | |||
| 523 | 519 | ||
| 524 | if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde) | 520 | if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde) |
| 525 | || (*cie & (sizeof(*cie) - 1)) | 521 | || (*cie & (sizeof(*cie) - 1)) |
| 526 | || (cie[1] != 0xffffffff) | 522 | || (cie[1] != 0xffffffff)) |
| 527 | || ( *(u8 *)(cie + 2) != 1)) /* version 1 supported */ | ||
| 528 | return NULL; /* this is not a (valid) CIE */ | 523 | return NULL; /* this is not a (valid) CIE */ |
| 529 | return cie; | 524 | return cie; |
| 530 | } | 525 | } |
