diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-bsp/u-boot/files/CVE-2024-57254.patch | 47 | ||||
| -rw-r--r-- | meta/recipes-bsp/u-boot/u-boot_2022.01.bb | 1 |
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-bsp/u-boot/files/CVE-2024-57254.patch b/meta/recipes-bsp/u-boot/files/CVE-2024-57254.patch new file mode 100644 index 0000000000..be00121224 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/CVE-2024-57254.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From 3f9deb424ecd6ecd50f165b42f0b0290d83853f5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Richard Weinberger <richard@nod.at> | ||
| 3 | Date: Fri, 2 Aug 2024 18:36:45 +0200 | ||
| 4 | Subject: [PATCH 1/8] squashfs: Fix integer overflow in sqfs_inode_size() | ||
| 5 | |||
| 6 | A carefully crafted squashfs filesystem can exhibit an extremly large | ||
| 7 | inode size and overflow the calculation in sqfs_inode_size(). | ||
| 8 | As a consequence, the squashfs driver will read from wrong locations. | ||
| 9 | |||
| 10 | Fix by using __builtin_add_overflow() to detect the overflow. | ||
| 11 | |||
| 12 | Signed-off-by: Richard Weinberger <richard@nod.at> | ||
| 13 | Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> | ||
| 14 | |||
| 15 | CVE: CVE-2024-57254 | ||
| 16 | Upstream-Status: Backport [https://source.denx.de/u-boot/u-boot/-/commit/c8e929e5758999933f9e905049ef2bf3fe6b140d] | ||
| 17 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 18 | --- | ||
| 19 | fs/squashfs/sqfs_inode.c | 9 +++++++-- | ||
| 20 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/fs/squashfs/sqfs_inode.c b/fs/squashfs/sqfs_inode.c | ||
| 23 | index d25cfb53..bb3ccd37 100644 | ||
| 24 | --- a/fs/squashfs/sqfs_inode.c | ||
| 25 | +++ b/fs/squashfs/sqfs_inode.c | ||
| 26 | @@ -78,11 +78,16 @@ int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size) | ||
| 27 | |||
| 28 | case SQFS_SYMLINK_TYPE: | ||
| 29 | case SQFS_LSYMLINK_TYPE: { | ||
| 30 | + int size; | ||
| 31 | + | ||
| 32 | struct squashfs_symlink_inode *symlink = | ||
| 33 | (struct squashfs_symlink_inode *)inode; | ||
| 34 | |||
| 35 | - return sizeof(*symlink) + | ||
| 36 | - get_unaligned_le32(&symlink->symlink_size); | ||
| 37 | + if (__builtin_add_overflow(sizeof(*symlink), | ||
| 38 | + get_unaligned_le32(&symlink->symlink_size), &size)) | ||
| 39 | + return -EINVAL; | ||
| 40 | + | ||
| 41 | + return size; | ||
| 42 | } | ||
| 43 | |||
| 44 | case SQFS_BLKDEV_TYPE: | ||
| 45 | -- | ||
| 46 | 2.34.1 | ||
| 47 | |||
diff --git a/meta/recipes-bsp/u-boot/u-boot_2022.01.bb b/meta/recipes-bsp/u-boot/u-boot_2022.01.bb index 62ebe40cb6..d9c6fcb993 100644 --- a/meta/recipes-bsp/u-boot/u-boot_2022.01.bb +++ b/meta/recipes-bsp/u-boot/u-boot_2022.01.bb | |||
| @@ -11,6 +11,7 @@ SRC_URI += " file://0001-riscv32-Use-double-float-ABI-for-rv32.patch \ | |||
| 11 | file://CVE-2022-30790.patch \ | 11 | file://CVE-2022-30790.patch \ |
| 12 | file://CVE-2022-2347_1.patch \ | 12 | file://CVE-2022-2347_1.patch \ |
| 13 | file://CVE-2022-2347_2.patch \ | 13 | file://CVE-2022-2347_2.patch \ |
| 14 | file://CVE-2024-57254.patch \ | ||
| 14 | " | 15 | " |
| 15 | 16 | ||
| 16 | DEPENDS += "bc-native dtc-native python3-setuptools-native" | 17 | DEPENDS += "bc-native dtc-native python3-setuptools-native" |
