@@ -293,13 +293,13 @@ static void init_unwind_hdr(struct unwind_table *table,
293
293
const u32 * cie = cie_for_fde (fde , table );
294
294
signed ptrType ;
295
295
296
- if (cie == & not_fde ) /* only process FDE here */
296
+ if (cie == & not_fde )
297
297
continue ;
298
298
if (cie == NULL || cie == & bad_cie )
299
- continue ; /* say FDE->CIE.version != 1 */
299
+ goto ret_err ;
300
300
ptrType = fde_pointer_type (cie );
301
301
if (ptrType < 0 )
302
- continue ;
302
+ goto ret_err ;
303
303
304
304
ptr = (const u8 * )(fde + 2 );
305
305
if (!read_pointer (& ptr , (const u8 * )(fde + 1 ) + * fde ,
@@ -315,14 +315,14 @@ static void init_unwind_hdr(struct unwind_table *table,
315
315
}
316
316
317
317
if (tableSize || !n )
318
- return ;
318
+ goto ret_err ;
319
319
320
320
hdrSize = 4 + sizeof (unsigned long ) + sizeof (unsigned int )
321
321
+ 2 * n * sizeof (unsigned long );
322
322
323
323
header = alloc (hdrSize );
324
324
if (!header )
325
- return ;
325
+ goto ret_err ;
326
326
327
327
header -> version = 1 ;
328
328
header -> eh_frame_ptr_enc = DW_EH_PE_abs | DW_EH_PE_native ;
@@ -343,10 +343,6 @@ static void init_unwind_hdr(struct unwind_table *table,
343
343
344
344
if (fde [1 ] == 0xffffffff )
345
345
continue ; /* this is a CIE */
346
-
347
- if (* (u8 * )(cie + 2 ) != 1 )
348
- continue ; /* FDE->CIE.version not supported */
349
-
350
346
ptr = (const u8 * )(fde + 2 );
351
347
header -> table [n ].start = read_pointer (& ptr ,
352
348
(const u8 * )(fde + 1 ) +
@@ -365,6 +361,10 @@ static void init_unwind_hdr(struct unwind_table *table,
365
361
table -> hdrsz = hdrSize ;
366
362
smp_wmb ();
367
363
table -> header = (const void * )header ;
364
+ return ;
365
+
366
+ ret_err :
367
+ panic ("Attention !!! Dwarf FDE parsing errors\n" );;
368
368
}
369
369
370
370
#ifdef CONFIG_MODULES
@@ -523,8 +523,7 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
523
523
524
524
if (* cie <= sizeof (* cie ) + 4 || * cie >= fde [1 ] - sizeof (* fde )
525
525
|| (* cie & (sizeof (* cie ) - 1 ))
526
- || (cie [1 ] != 0xffffffff )
527
- || ( * (u8 * )(cie + 2 ) != 1 )) /* version 1 supported */
526
+ || (cie [1 ] != 0xffffffff ))
528
527
return NULL ; /* this is not a (valid) CIE */
529
528
return cie ;
530
529
}
@@ -605,9 +604,6 @@ static signed fde_pointer_type(const u32 *cie)
605
604
const u8 * ptr = (const u8 * )(cie + 2 );
606
605
unsigned version = * ptr ;
607
606
608
- if (version != 1 )
609
- return -1 ; /* unsupported */
610
-
611
607
if (* ++ ptr ) {
612
608
const char * aug ;
613
609
const u8 * end = (const u8 * )(cie + 1 ) + * cie ;
@@ -1019,9 +1015,7 @@ int arc_unwind(struct unwind_frame_info *frame)
1019
1015
ptr = (const u8 * )(cie + 2 );
1020
1016
end = (const u8 * )(cie + 1 ) + * cie ;
1021
1017
frame -> call_frame = 1 ;
1022
- if ((state .version = * ptr ) != 1 )
1023
- cie = NULL ; /* unsupported version */
1024
- else if (* ++ ptr ) {
1018
+ if (* ++ ptr ) {
1025
1019
/* check if augmentation size is first (thus present) */
1026
1020
if (* ptr == 'z' ) {
1027
1021
while (++ ptr < end && * ptr ) {
0 commit comments