openwrt/target/linux
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
..
apm821xx treewide: replace backticks by $(...) in gen_*_img.sh scripts 2019-09-29 00:46:13 +02:00
ar7 kernel: bump 4.9 to 4.9.194 2019-09-24 12:52:05 +02:00
ar71xx kernel: bump 4.14 to 4.14.147 2019-10-08 12:44:35 +02:00
arc770 treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
archs38 treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
armvirt
at91 treewide: replace backticks by $(...) in gen_*_img.sh scripts 2019-09-29 00:46:13 +02:00
ath25 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup 2019-09-11 09:05:35 +02:00
ath79 kernel: bump 4.14 to 4.14.147 2019-10-08 12:44:35 +02:00
bcm53xx bcm53xx: fix serial console on Luxul XWC-2000 2019-10-04 15:46:23 +02:00
brcm47xx brcm47xx: sysupgrade: fix device model detection 2019-09-26 06:51:16 +02:00
brcm63xx kernel: bump 4.14 to 4.14.145 2019-09-20 15:51:49 +02:00
brcm2708 kernel: bump 4.19 to 4.19.77 2019-10-08 12:44:35 +02:00
cns3xxx
gemini treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
generic kernel: Fix off-by-one error in FIT mtd partition search. 2019-10-09 14:45:25 +02:00
imx6 imx6: install-dtb as separate IMAGE 2019-09-15 15:00:17 +00:00
ipq40xx ipq40xx: abort ar40xx probe on missing PHYs 2019-09-25 22:42:03 +02:00
ipq806x treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
ixp4xx treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
kirkwood treewide: sync bootcount scripts across targets 2019-08-17 23:52:34 +08:00
lantiq treewide: fix hex2dec conversion for MAC address checksum offset 2019-09-29 00:46:13 +02:00
layerscape kernel: bump 4.14 to 4.14.147 2019-10-08 12:44:35 +02:00
malta
mediatek treewide: remove kmod-usb-core from DEVICE_PACKAGES 2019-10-06 21:28:49 +02:00
mpc85xx mpc85xx: provide label MAC address 2019-09-19 23:43:27 +02:00
mvebu kernel: bump 4.19 to 4.19.78 2019-10-08 15:51:06 +02:00
mxs treewide: replace backticks by $(...) in gen_*_img.sh scripts 2019-09-29 00:46:13 +02:00
octeon octeon: replace backticks by $(...) 2019-09-29 00:46:13 +02:00
octeontx
omap treewide: replace backticks by $(...) in gen_*_img.sh scripts 2019-09-29 00:46:13 +02:00
orion orion: replace backticks by $(...) 2019-09-29 00:46:13 +02:00
oxnas
pistachio
ramips kernel: bump 4.14 to 4.14.147 2019-10-08 12:44:35 +02:00
rb532 treewide: replace backticks by $(...) in gen_*_img.sh scripts 2019-09-29 00:46:13 +02:00
samsung samsung: split up DEVICE_TITLE 2019-09-11 15:17:09 +02:00
sunxi sunxi: update kernel config 2019-10-06 21:28:49 +02:00
tegra treewide: use new procd sysupgrade $UPGRADE_BACKUP variable 2019-09-05 23:33:19 +02:00
uml
x86 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable 2019-09-05 23:33:19 +02:00
zynq kernel: bump 4.19 to 4.19.77 2019-10-08 12:44:35 +02:00
Makefile