You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
5 years ago
..
apm821xx treewide: replace backticks by $(...) in gen_*_img.sh scripts 5 years ago
ar7 kernel: bump 4.9 to 4.9.194 5 years ago
ar71xx kernel: bump 4.14 to 4.14.147 5 years ago
arc770 treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
archs38 treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
armvirt armvirt: fix overlay support by updating to f2fs/ext4 based overlays 5 years ago
at91 treewide: replace backticks by $(...) in gen_*_img.sh scripts 5 years ago
ath25 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup 5 years ago
ath79 kernel: bump 4.14 to 4.14.147 5 years ago
bcm53xx bcm53xx: fix serial console on Luxul XWC-2000 5 years ago
brcm47xx brcm47xx: sysupgrade: fix device model detection 5 years ago
brcm63xx kernel: bump 4.14 to 4.14.145 5 years ago
brcm2708 kernel: bump 4.19 to 4.19.77 5 years ago
cns3xxx treewide: sysupgrade: don't use $ARGV in platform_do_upgrade() 5 years ago
gemini treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
generic kernel: Fix off-by-one error in FIT mtd partition search. 5 years ago
imx6 imx6: install-dtb as separate IMAGE 5 years ago
ipq40xx ipq40xx: abort ar40xx probe on missing PHYs 5 years ago
ipq806x treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
ixp4xx treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
kirkwood treewide: sync bootcount scripts across targets 5 years ago
lantiq treewide: fix hex2dec conversion for MAC address checksum offset 5 years ago
layerscape kernel: bump 4.14 to 4.14.147 5 years ago
malta malta: fix overlay support by updating to f2fs/ext4 based overlays 5 years ago
mediatek treewide: remove kmod-usb-core from DEVICE_PACKAGES 5 years ago
mpc85xx mpc85xx: provide label MAC address 5 years ago
mvebu kernel: bump 4.19 to 4.19.78 5 years ago
mxs treewide: replace backticks by $(...) in gen_*_img.sh scripts 5 years ago
octeon octeon: replace backticks by $(...) 5 years ago
octeontx kernel: Remove CONFIG_COMPAT 5 years ago
omap treewide: replace backticks by $(...) in gen_*_img.sh scripts 5 years ago
orion orion: replace backticks by $(...) 5 years ago
oxnas oxnas: convert DEVICE_TITLE to new variables 5 years ago
pistachio treewide: sysupgrade: get rid of platform_nand_pre_upgrade() 5 years ago
ramips kernel: bump 4.14 to 4.14.147 5 years ago
rb532 treewide: replace backticks by $(...) in gen_*_img.sh scripts 5 years ago
samsung samsung: split up DEVICE_TITLE 5 years ago
sunxi sunxi: update kernel config 5 years ago
tegra treewide: use new procd sysupgrade $UPGRADE_BACKUP variable 5 years ago
uml kernel: Deactivate CONFIG_BINFMT_MISC 5 years ago
x86 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable 5 years ago
zynq kernel: bump 4.19 to 4.19.77 5 years ago
Makefile