Skip to content

Commit d662198

Browse files
committed
hpet: Replace one-element array with flexible-array member
One-element arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3. Replace one-element array with flexible-array member in struct hpet. This results in no differences in binary output. The use of struct hpet is never used with sizeof() and accesses via hpet_timers array are already done after explicit bounds checking. [1] KSPP#79 Cc: Clemens Ladisch <[email protected]> Cc: "Gustavo A. R. Silva" <[email protected]> Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bdc7750 commit d662198

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/hpet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct hpet {
3030
unsigned long _hpet_compare;
3131
} _u1;
3232
u64 hpet_fsb[2]; /* FSB route */
33-
} hpet_timers[1];
33+
} hpet_timers[];
3434
};
3535

3636
#define hpet_mc _u0._hpet_mc

0 commit comments

Comments
 (0)