Re: [PATCH] comedi: Annotate struct comedi_lrange with __counted_by

2023-11-05 Thread Christophe JAILLET
Le 01/10/2023 à 23:22, Kees Cook a écrit : On Sun, Oct 01, 2023 at 02:05:46PM -0700, Kees Cook wrote: On Sun, Oct 01, 2023 at 09:14:02PM +0200, Julia Lawall wrote: Kees, You can try the following. Cool! Yeah, this finds the example: drivers/comedi/drivers/rti800.c:74: struct comedi_lrange:

[PATCH] pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()

2023-11-05 Thread Sergey Shtylyov
In persistent_ram_init_ecc(), on 64-bit arches DIV_ROUND_UP() will return 64-bit value since persistent_ram_zone::buffer_size has type size_t which is derived from the 64-bit *unsigned long*, while the ecc_blocks variable this value gets assigned to has (always 32-bit) *int* type. Even if that val