diff options
Diffstat (limited to 'target/linux/generic')
7 files changed, 8 insertions, 77 deletions
diff --git a/target/linux/generic/backport-5.10/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch b/target/linux/generic/backport-5.10/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch deleted file mode 100644 index 3298ec1ce4..0000000000 --- a/target/linux/generic/backport-5.10/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 Mon Sep 17 00:00:00 2001 -From: Zhihao Cheng <chengzhihao1@huawei.com> -Date: Mon, 6 Mar 2023 09:33:08 +0800 -Subject: [PATCH] ubi: Fix failure attaching when vid_hdr offset equals to - (sub)page size - -Following process will make ubi attaching failed since commit -1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"): - -ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB -modprobe nandsim id_bytes=$ID -flash_eraseall /dev/mtd0 -modprobe ubi mtd="0,2048" # set vid_hdr offset as 2048 (one page) -(dmesg): - ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large. - UBI error: cannot attach mtd0 - UBI error: cannot initialize UBI, error -22 - -Rework original solution, the key point is making sure -'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize', -so we should check vid_hdr_shift rather not vid_hdr_offset. -Then, ubi still support (sub)page aligined VID header offset. - -Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size") -Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> -Tested-by: Nicolas Schichan <nschichan@freebox.fr> -Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> # v5.10, v4.19 -Signed-off-by: Richard Weinberger <richard@nod.at> ---- - drivers/mtd/ubi/build.c | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - ---- a/drivers/mtd/ubi/build.c -+++ b/drivers/mtd/ubi/build.c -@@ -665,12 +665,6 @@ static int io_init(struct ubi_device *ub - ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size); - ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size); - -- if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset + UBI_VID_HDR_SIZE) > -- ubi->vid_hdr_alsize)) { -- ubi_err(ubi, "VID header offset %d too large.", ubi->vid_hdr_offset); -- return -EINVAL; -- } -- - dbg_gen("min_io_size %d", ubi->min_io_size); - dbg_gen("max_write_size %d", ubi->max_write_size); - dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size); -@@ -688,6 +682,21 @@ static int io_init(struct ubi_device *ub - ubi->vid_hdr_aloffset; - } - -+ /* -+ * Memory allocation for VID header is ubi->vid_hdr_alsize -+ * which is described in comments in io.c. -+ * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds -+ * ubi->vid_hdr_alsize, so that all vid header operations -+ * won't access memory out of bounds. -+ */ -+ if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) { -+ ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)" -+ " + VID header size(%zu) > VID header aligned size(%d).", -+ ubi->vid_hdr_offset, ubi->vid_hdr_shift, -+ UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize); -+ return -EINVAL; -+ } -+ - /* Similar for the data offset */ - ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE; - ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); diff --git a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index 901792178d..583abc9c80 100644 --- a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -423,7 +423,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> if (bgmac->irq < 0) --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c -@@ -4480,7 +4480,6 @@ static int macb_probe(struct platform_de +@@ -4484,7 +4484,6 @@ static int macb_probe(struct platform_de struct net_device *dev; struct resource *regs; void __iomem *mem; @@ -431,7 +431,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> struct macb *bp; int err, val; -@@ -4593,15 +4592,11 @@ static int macb_probe(struct platform_de +@@ -4597,15 +4596,11 @@ static int macb_probe(struct platform_de if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR) bp->rx_intr_mask |= MACB_BIT(RXUBR); @@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> int irq; --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -5015,7 +5015,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -5019,7 +5019,7 @@ int stmmac_dvr_probe(struct device *devi priv->wol_irq = res->wol_irq; priv->lpi_irq = res->lpi_irq; diff --git a/target/linux/generic/hack-5.10/204-module_strip.patch b/target/linux/generic/hack-5.10/204-module_strip.patch index 9f7eaf479a..1dc3eb2752 100644 --- a/target/linux/generic/hack-5.10/204-module_strip.patch +++ b/target/linux/generic/hack-5.10/204-module_strip.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> --- a/init/Kconfig +++ b/init/Kconfig -@@ -2352,6 +2352,13 @@ config UNUSED_KSYMS_WHITELIST +@@ -2364,6 +2364,13 @@ config UNUSED_KSYMS_WHITELIST one per line. The path can be absolute, or relative to the kernel source tree. diff --git a/target/linux/generic/hack-5.10/253-ksmbd-config.patch b/target/linux/generic/hack-5.10/253-ksmbd-config.patch index 81da6d8f52..6fb9de3b05 100644 --- a/target/linux/generic/hack-5.10/253-ksmbd-config.patch +++ b/target/linux/generic/hack-5.10/253-ksmbd-config.patch @@ -12,7 +12,7 @@ Submitted-by: Rosen Penev <rosenp@gmail.com> --- a/init/Kconfig +++ b/init/Kconfig -@@ -2384,7 +2384,7 @@ config PADATA +@@ -2396,7 +2396,7 @@ config PADATA bool config ASN1 diff --git a/target/linux/generic/hack-5.10/410-block-fit-partition-parser.patch b/target/linux/generic/hack-5.10/410-block-fit-partition-parser.patch index acad393906..52d8e24d0f 100644 --- a/target/linux/generic/hack-5.10/410-block-fit-partition-parser.patch +++ b/target/linux/generic/hack-5.10/410-block-fit-partition-parser.patch @@ -178,7 +178,7 @@ Submitted-by: Daniel Golle <daniel@makrotopia.org> __le64 signature; --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c -@@ -334,7 +334,11 @@ static void mtdblock_remove_dev(struct m +@@ -338,7 +338,11 @@ static void mtdblock_remove_dev(struct m static struct mtd_blktrans_ops mtdblock_tr = { .name = "mtdblock", .major = MTD_BLOCK_MAJOR, diff --git a/target/linux/generic/pending-5.10/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-5.10/203-kallsyms_uncompressed.patch index eee4a38657..190ce0720d 100644 --- a/target/linux/generic/pending-5.10/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-5.10/203-kallsyms_uncompressed.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> --- a/init/Kconfig +++ b/init/Kconfig -@@ -1389,6 +1389,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW +@@ -1401,6 +1401,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW the unaligned access emulation. see arch/parisc/kernel/unaligned.c for reference diff --git a/target/linux/generic/pending-5.10/920-mangle_bootargs.patch b/target/linux/generic/pending-5.10/920-mangle_bootargs.patch index 63edda11b0..390152078f 100644 --- a/target/linux/generic/pending-5.10/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.10/920-mangle_bootargs.patch @@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org> --- a/init/Kconfig +++ b/init/Kconfig -@@ -1805,6 +1805,15 @@ config EMBEDDED +@@ -1817,6 +1817,15 @@ config EMBEDDED an embedded system so certain expert options are available for configuration. |