KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Replace 1-element array in drivers/md/raid5.h #247

Closed GustavoARSilva closed 6 months ago

GustavoARSilva commented 1 year ago

Replace one-element array with flexible-array member:

drivers/md/raid5.h-258- struct r5dev {
drivers/md/raid5.h-259-         /* rreq and rvec are used for the replacement device when
drivers/md/raid5.h-260-          * writing data to both devices.
drivers/md/raid5.h-261-          */
drivers/md/raid5.h-262-         struct bio      req, rreq;
drivers/md/raid5.h-263-         struct bio_vec  vec, rvec;
drivers/md/raid5.h-264-         struct page     *page, *orig_page;
drivers/md/raid5.h-265-         unsigned int    offset;     /* offset of the page */
drivers/md/raid5.h-266-         struct bio      *toread, *read, *towrite, *written;
drivers/md/raid5.h-267-         sector_t        sector;                 /* sector of this page */
drivers/md/raid5.h-268-         unsigned long   flags;
drivers/md/raid5.h-269-         u32             log_checksum;
drivers/md/raid5.h-270-         unsigned short  write_hint;
drivers/md/raid5.h-271- } dev[1];
kees commented 1 year ago

https://lore.kernel.org/lkml/20230522212114.gonna.589-kees@kernel.org/

kees commented 6 months ago

Fixed in commit 2f088dfc18781.