openwrt/target/linux/generic
Oldřich Jedlička e0ce80d42a kernel: Fix off-by-one error in FIT mtd partition search.
This fixes off-by-one error introduced in commit dc76900021
("kernel: Correctly search for the FIT image in mtd partition.")

Function `mtd_read` starts reading at `offset` and
needs `hdr_len` number of bytes to be available. Suppose
the easiest case when `offset` is `0` and `hdr_len` equals
to `mtd->size` - the `for` loop will not be entered even
when enough bytes are available to be read.

Same happens for any non-zero `offset`, when `hdr_len` is
just enough bytes to be read until `mtd->size` is reached.
Imagine that for example `mtd->size=5`, `offset=4` and
`hdr_len=1`. Then `offset+hdr_len=5` and the check has to
be `offset+hdr_len <= mtd->size`, i.e. `5 <= 5`. The
check for `offset + hdr_len` value needs to be inclusive,
therefore use `<=`.

Fixes: dc76900021 ("kernel: Correctly search for the FIT image in mtd partition.")
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
[adjusted commit ref, fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-10-09 14:45:25 +02:00
..
backport-4.9 kernel: bump 4.9 to 4.9.196 2019-10-08 15:51:06 +02:00
backport-4.14 kernel: bump 4.14 to 4.14.148 2019-10-08 15:51:06 +02:00
backport-4.19 kernel: fix issues with output routing in flow offload 2019-09-25 20:11:20 +02:00
files kernel: Fix off-by-one error in FIT mtd partition search. 2019-10-09 14:45:25 +02:00
hack-4.9 kernel: bump 4.9 to 4.9.196 2019-10-08 15:51:06 +02:00
hack-4.14 kernel: bump 4.14 to 4.14.148 2019-10-08 15:51:06 +02:00
hack-4.19 kernel: bump 4.19 to 4.19.78 2019-10-08 15:51:06 +02:00
image treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
other-files kernel: move initramfs's init script out of base-files 2017-04-04 14:06:40 +02:00
pending-4.9 kernel: bump 4.9 to 4.9.195 2019-10-08 12:44:35 +02:00
pending-4.14 kernel: bump 4.14 to 4.14.148 2019-10-08 15:51:06 +02:00
pending-4.19 kernel: bump 4.19 to 4.19.78 2019-10-08 15:51:06 +02:00
config-4.9 kernel: move crypto-arc4 into a module 2019-08-26 18:21:13 +02:00
config-4.14 kernel: move crypto-arc4 into a module 2019-08-26 18:21:13 +02:00
config-4.19 kernel: move crypto-arc4 into a module 2019-08-26 18:21:13 +02:00
PATCHES