In the Linux kernel, the following vulnerability has been resolved: md/raid5: validate payload size before calculating payload_len Commit b0cc3ae97e89 ("md/raid5: validate payload size before accessing journal metadata") introduced a bounds check to verify that a given payload fits into the current metadata block. In order to calculate the payload size, it has to access the members payload->header.type and payload->size, the offset of which may already be past the end of the metadata block, because the loop condition only checks that the first byte of the payload is inside, and the payload entries have variable sizes. Later on, payload->checksum[0] and payload->checksum[1] are accessed without verifying that payload->size is large enough. Add another check to make sure that payload->size can be safely accessed, and make sure that the checksum fields are accessible. This issue has been found by AI (gemma4, Gemini) during a backport review.
https://git.kernel.org/stable/c/ff790668336ec161eafa51856424df9c8532335c
https://git.kernel.org/stable/c/f738b316264276c8456c5e7a706bd3f6ff157122
https://git.kernel.org/stable/c/9e2913245294f1b8390b8b5ecee67485f18cb432
https://git.kernel.org/stable/c/708060d87b092e107504df4390aa83c4687c445f
https://git.kernel.org/stable/c/62fb156158caacd865a6933fbb602597c3053e6f
https://git.kernel.org/stable/c/5c9a7eea926fdaed105da882e3bf3c5d11ea26f8
https://git.kernel.org/stable/c/38c795105992bbaa3418dd39cbff7348ad17537c
https://git.kernel.org/stable/c/022bee23973a10e19f1cd260825d4bbca63eb3a1