Re: [PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-20 Thread Zheyu Ma
On Thu, Jun 20, 2024 at 2:35 PM Cédric Le Goater wrote: > > >> @@ -75,6 +75,7 @@ struct AspeedGPIOClass { > >> uint32_t nr_gpio_pins; > >> uint32_t nr_gpio_sets; > >> const AspeedGPIOReg *reg_table; > >> +uint32_t reg_table_size; > >> }; > > > > - "reg_table_size" is a num

Re: [PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-20 Thread Cédric Le Goater
@@ -75,6 +75,7 @@ struct AspeedGPIOClass {   uint32_t nr_gpio_pins;   uint32_t nr_gpio_sets;   const AspeedGPIOReg *reg_table; +    uint32_t reg_table_size;   }; - "reg_table_size" is a number of registers, using s/size/count/ might   be clearer. - No point in specifying 32-bit,

Re: [PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-20 Thread Philippe Mathieu-Daudé
Hi, On 19/6/24 20:36, Zheyu Ma wrote: ASan detected a global-buffer-overflow error in the aspeed_gpio_read() function. This issue occurred when reading beyond the bounds of the reg_table. To enhance the safety and maintainability of the Aspeed GPIO code, this commit introduces a reg_table_size

Re: [PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-19 Thread Cédric Le Goater
On 6/19/24 8:36 PM, Zheyu Ma wrote: ASan detected a global-buffer-overflow error in the aspeed_gpio_read() function. This issue occurred when reading beyond the bounds of the reg_table. To enhance the safety and maintainability of the Aspeed GPIO code, this commit introduces a reg_table_size mem

Re: [PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-19 Thread Andrew Jeffery
On Wed, 2024-06-19 at 20:36 +0200, Zheyu Ma wrote: > ASan detected a global-buffer-overflow error in the aspeed_gpio_read() > function. This issue occurred when reading beyond the bounds of the > reg_table. > > To enhance the safety and maintainability of the Aspeed GPIO code, this commit > introd

[PATCH v3] hw/gpio/aspeed: Add reg_table_size to AspeedGPIOClass

2024-06-19 Thread Zheyu Ma
ASan detected a global-buffer-overflow error in the aspeed_gpio_read() function. This issue occurred when reading beyond the bounds of the reg_table. To enhance the safety and maintainability of the Aspeed GPIO code, this commit introduces a reg_table_size member to the AspeedGPIOClass structure.