Compare commits
10 Commits
abb42317e6
...
13b83151c5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13b83151c5 | ||
|
|
66dad5bff6 | ||
|
|
e1ef6284e1 | ||
|
|
358eb1f107 | ||
|
|
7ce4807118 | ||
|
|
d6f980a9f9 | ||
|
|
b89530d1f5 | ||
|
|
bcc26a853c | ||
|
|
185045844b | ||
|
|
34a932dd91 |
122
backport-0001-CVE-2022-2347.patch
Normal file
122
backport-0001-CVE-2022-2347.patch
Normal file
@ -0,0 +1,122 @@
|
||||
From fbce985e28eaca3af82afecc11961aadaf971a7e Mon Sep 17 00:00:00 2001
|
||||
From: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
|
||||
Date: Thu, 3 Nov 2022 09:37:48 +0530
|
||||
Subject: [PATCH] usb: gadget: dfu: Fix the unchecked length field
|
||||
|
||||
DFU implementation does not bound the length field in USB
|
||||
DFU download setup packets, and it does not verify that
|
||||
the transfer direction. Fixing the length and transfer
|
||||
direction.
|
||||
|
||||
CVE-2022-2347
|
||||
|
||||
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
|
||||
Reviewed-by: Marek Vasut <marex@denx.de>
|
||||
---
|
||||
drivers/usb/gadget/f_dfu.c | 56 ++++++++++++++++++++++++--------------
|
||||
1 file changed, 37 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
|
||||
index e9340ff5cb4d..33ef62f8babe 100644
|
||||
--- a/drivers/usb/gadget/f_dfu.c
|
||||
+++ b/drivers/usb/gadget/f_dfu.c
|
||||
@@ -321,21 +321,29 @@ static int state_dfu_idle(struct f_dfu *f_dfu,
|
||||
u16 len = le16_to_cpu(ctrl->wLength);
|
||||
int value = 0;
|
||||
|
||||
+ len = len > DFU_USB_BUFSIZ ? DFU_USB_BUFSIZ : len;
|
||||
+
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_DNLOAD:
|
||||
- if (len == 0) {
|
||||
- f_dfu->dfu_state = DFU_STATE_dfuERROR;
|
||||
- value = RET_STALL;
|
||||
- break;
|
||||
+ if (ctrl->bRequestType == USB_DIR_OUT) {
|
||||
+ if (len == 0) {
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuERROR;
|
||||
+ value = RET_STALL;
|
||||
+ break;
|
||||
+ }
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
|
||||
+ f_dfu->blk_seq_num = w_value;
|
||||
+ value = handle_dnload(gadget, len);
|
||||
}
|
||||
- f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
|
||||
- f_dfu->blk_seq_num = w_value;
|
||||
- value = handle_dnload(gadget, len);
|
||||
break;
|
||||
case USB_REQ_DFU_UPLOAD:
|
||||
- f_dfu->dfu_state = DFU_STATE_dfuUPLOAD_IDLE;
|
||||
- f_dfu->blk_seq_num = 0;
|
||||
- value = handle_upload(req, len);
|
||||
+ if (ctrl->bRequestType == USB_DIR_IN) {
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuUPLOAD_IDLE;
|
||||
+ f_dfu->blk_seq_num = 0;
|
||||
+ value = handle_upload(req, len);
|
||||
+ if (value >= 0 && value < len)
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuIDLE;
|
||||
+ }
|
||||
break;
|
||||
case USB_REQ_DFU_ABORT:
|
||||
/* no zlp? */
|
||||
@@ -426,11 +432,15 @@ static int state_dfu_dnload_idle(struct f_dfu *f_dfu,
|
||||
u16 len = le16_to_cpu(ctrl->wLength);
|
||||
int value = 0;
|
||||
|
||||
+ len = len > DFU_USB_BUFSIZ ? DFU_USB_BUFSIZ : len;
|
||||
+
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_DNLOAD:
|
||||
- f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
|
||||
- f_dfu->blk_seq_num = w_value;
|
||||
- value = handle_dnload(gadget, len);
|
||||
+ if (ctrl->bRequestType == USB_DIR_OUT) {
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
|
||||
+ f_dfu->blk_seq_num = w_value;
|
||||
+ value = handle_dnload(gadget, len);
|
||||
+ }
|
||||
break;
|
||||
case USB_REQ_DFU_ABORT:
|
||||
f_dfu->dfu_state = DFU_STATE_dfuIDLE;
|
||||
@@ -513,13 +523,17 @@ static int state_dfu_upload_idle(struct f_dfu *f_dfu,
|
||||
u16 len = le16_to_cpu(ctrl->wLength);
|
||||
int value = 0;
|
||||
|
||||
+ len = len > DFU_USB_BUFSIZ ? DFU_USB_BUFSIZ : len;
|
||||
+
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_UPLOAD:
|
||||
- /* state transition if less data then requested */
|
||||
- f_dfu->blk_seq_num = w_value;
|
||||
- value = handle_upload(req, len);
|
||||
- if (value >= 0 && value < len)
|
||||
- f_dfu->dfu_state = DFU_STATE_dfuIDLE;
|
||||
+ if (ctrl->bRequestType == USB_DIR_IN) {
|
||||
+ /* state transition if less data then requested */
|
||||
+ f_dfu->blk_seq_num = w_value;
|
||||
+ value = handle_upload(req, len);
|
||||
+ if (value >= 0 && value < len)
|
||||
+ f_dfu->dfu_state = DFU_STATE_dfuIDLE;
|
||||
+ }
|
||||
break;
|
||||
case USB_REQ_DFU_ABORT:
|
||||
f_dfu->dfu_state = DFU_STATE_dfuIDLE;
|
||||
@@ -595,6 +609,8 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
|
||||
int value = 0;
|
||||
u8 req_type = ctrl->bRequestType & USB_TYPE_MASK;
|
||||
|
||||
+ len = len > DFU_USB_BUFSIZ ? DFU_USB_BUFSIZ : len;
|
||||
+
|
||||
debug("w_value: 0x%x len: 0x%x\n", w_value, len);
|
||||
debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
|
||||
req_type, ctrl->bRequest, f_dfu->dfu_state);
|
||||
@@ -614,7 +630,7 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
|
||||
value = dfu_state[f_dfu->dfu_state] (f_dfu, ctrl, gadget, req);
|
||||
|
||||
if (value >= 0) {
|
||||
- req->length = value;
|
||||
+ req->length = value > DFU_USB_BUFSIZ ? DFU_USB_BUFSIZ : value;
|
||||
req->zero = value < len;
|
||||
value = usb_ep_queue(gadget->ep0, req, 0);
|
||||
if (value < 0) {
|
||||
40
backport-0001-CVE-2024-57258.patch
Normal file
40
backport-0001-CVE-2024-57258.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 0a10b49206a29b4aa2f80233a3e53ca0466bb0b3 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 12:08:45 +0200
|
||||
Subject: [PATCH] dlmalloc: Fix integer overflow in sbrk()
|
||||
|
||||
Make sure that the new break is within mem_malloc_start
|
||||
and mem_malloc_end before making progress.
|
||||
ulong new = old + increment; can overflow for extremely large
|
||||
increment values and memset() can get wrongly called.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
common/dlmalloc.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
|
||||
index 48e83da6cbce..8e201ac0dc59 100644
|
||||
--- a/common/dlmalloc.c
|
||||
+++ b/common/dlmalloc.c
|
||||
@@ -581,6 +581,9 @@ void *sbrk(ptrdiff_t increment)
|
||||
ulong old = mem_malloc_brk;
|
||||
ulong new = old + increment;
|
||||
|
||||
+ if ((new < mem_malloc_start) || (new > mem_malloc_end))
|
||||
+ return (void *)MORECORE_FAILURE;
|
||||
+
|
||||
/*
|
||||
* if we are giving memory back make sure we clear it out since
|
||||
* we set MORECORE_CLEARS to 1
|
||||
@@ -588,9 +591,6 @@ void *sbrk(ptrdiff_t increment)
|
||||
if (increment < 0)
|
||||
memset((void *)new, 0, -increment);
|
||||
|
||||
- if ((new < mem_malloc_start) || (new > mem_malloc_end))
|
||||
- return (void *)MORECORE_FAILURE;
|
||||
-
|
||||
mem_malloc_brk = new;
|
||||
|
||||
return (void *)old;
|
||||
59
backport-0002-CVE-2022-2347.patch
Normal file
59
backport-0002-CVE-2022-2347.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From 14dc0ab138988a8e45ffa086444ec8db48b3f103 Mon Sep 17 00:00:00 2001
|
||||
From: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
|
||||
Date: Wed, 30 Nov 2022 09:29:16 +0100
|
||||
Subject: [PATCH] usb: gadget: dfu: Fix check of transfer direction
|
||||
|
||||
Commit fbce985e28eaca3af82afecc11961aadaf971a7e to fix CVE-2022-2347
|
||||
blocks DFU usb requests.
|
||||
The verification of the transfer direction was done by an equality
|
||||
but it is a bit mask.
|
||||
|
||||
Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
|
||||
Reviewed-by: Fabio Estevam <festevam@denx.de>
|
||||
Reviewed-by: Sultan Qasim Khan <sultan.qasimkhan@nccgroup.com>
|
||||
Reviewed-by: Marek Vasut <marex@denx.de>
|
||||
Tested-by: Marek Vasut <marex@denx.de>
|
||||
---
|
||||
drivers/usb/gadget/f_dfu.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
|
||||
index 33ef62f8babe..44877df4ec6b 100644
|
||||
--- a/drivers/usb/gadget/f_dfu.c
|
||||
+++ b/drivers/usb/gadget/f_dfu.c
|
||||
@@ -325,7 +325,7 @@ static int state_dfu_idle(struct f_dfu *f_dfu,
|
||||
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_DNLOAD:
|
||||
- if (ctrl->bRequestType == USB_DIR_OUT) {
|
||||
+ if (!(ctrl->bRequestType & USB_DIR_IN)) {
|
||||
if (len == 0) {
|
||||
f_dfu->dfu_state = DFU_STATE_dfuERROR;
|
||||
value = RET_STALL;
|
||||
@@ -337,7 +337,7 @@ static int state_dfu_idle(struct f_dfu *f_dfu,
|
||||
}
|
||||
break;
|
||||
case USB_REQ_DFU_UPLOAD:
|
||||
- if (ctrl->bRequestType == USB_DIR_IN) {
|
||||
+ if (ctrl->bRequestType & USB_DIR_IN) {
|
||||
f_dfu->dfu_state = DFU_STATE_dfuUPLOAD_IDLE;
|
||||
f_dfu->blk_seq_num = 0;
|
||||
value = handle_upload(req, len);
|
||||
@@ -436,7 +436,7 @@ static int state_dfu_dnload_idle(struct f_dfu *f_dfu,
|
||||
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_DNLOAD:
|
||||
- if (ctrl->bRequestType == USB_DIR_OUT) {
|
||||
+ if (!(ctrl->bRequestType & USB_DIR_IN)) {
|
||||
f_dfu->dfu_state = DFU_STATE_dfuDNLOAD_SYNC;
|
||||
f_dfu->blk_seq_num = w_value;
|
||||
value = handle_dnload(gadget, len);
|
||||
@@ -527,7 +527,7 @@ static int state_dfu_upload_idle(struct f_dfu *f_dfu,
|
||||
|
||||
switch (ctrl->bRequest) {
|
||||
case USB_REQ_DFU_UPLOAD:
|
||||
- if (ctrl->bRequestType == USB_DIR_IN) {
|
||||
+ if (ctrl->bRequestType & USB_DIR_IN) {
|
||||
/* state transition if less data then requested */
|
||||
f_dfu->blk_seq_num = w_value;
|
||||
value = handle_upload(req, len);
|
||||
36
backport-0002-CVE-2024-57258.patch
Normal file
36
backport-0002-CVE-2024-57258.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 8642b2178d2c4002c99a0b69a845a48f2ae2706f Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 12:08:44 +0200
|
||||
Subject: [PATCH] dlmalloc: Fix integer overflow in request2size()
|
||||
|
||||
req is of type size_t, casting it to long opens the door
|
||||
for an integer overflow.
|
||||
Values between LONG_MAX - (SIZE_SZ + MALLOC_ALIGN_MASK) - 1 and LONG_MAX
|
||||
cause and overflow such that request2size() returns MINSIZE.
|
||||
|
||||
Fix by removing the cast.
|
||||
The origin of the cast is unclear, it's in u-boot and ppcboot since ever
|
||||
and predates the CVS history.
|
||||
Doug Lea's original dlmalloc implementation also doesn't have it.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
common/dlmalloc.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
|
||||
index 1e1602a24dec..48e83da6cbce 100644
|
||||
--- a/common/dlmalloc.c
|
||||
+++ b/common/dlmalloc.c
|
||||
@@ -386,8 +386,8 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
/* pad request bytes into a usable size */
|
||||
|
||||
#define request2size(req) \
|
||||
- (((long)((req) + (SIZE_SZ + MALLOC_ALIGN_MASK)) < \
|
||||
- (long)(MINSIZE + MALLOC_ALIGN_MASK)) ? MINSIZE : \
|
||||
+ ((((req) + (SIZE_SZ + MALLOC_ALIGN_MASK)) < \
|
||||
+ (MINSIZE + MALLOC_ALIGN_MASK)) ? MINSIZE : \
|
||||
(((req) + (SIZE_SZ + MALLOC_ALIGN_MASK)) & ~(MALLOC_ALIGN_MASK)))
|
||||
|
||||
/* Check if m has acceptable alignment */
|
||||
33
backport-0003-CVE-2024-57258.patch
Normal file
33
backport-0003-CVE-2024-57258.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From c17b2a05dd50a3ba437e6373093a0d6a359cdee0 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 12:08:43 +0200
|
||||
Subject: [PATCH] x86: Fix ptrdiff_t for x86_64
|
||||
|
||||
sbrk() assumes ptrdiff_t is large enough to enlarge/shrink the heap
|
||||
by LONG_MIN/LONG_MAX.
|
||||
So, use the long type, also to match the rest of the Linux ecosystem.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Simon Glass <sjg@chromium.org>
|
||||
---
|
||||
arch/x86/include/asm/posix_types.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h
|
||||
index dbcea7f47ff9..e1ed9bcabc76 100644
|
||||
--- a/arch/x86/include/asm/posix_types.h
|
||||
+++ b/arch/x86/include/asm/posix_types.h
|
||||
@@ -20,11 +20,12 @@ typedef unsigned short __kernel_gid_t;
|
||||
#if defined(__x86_64__)
|
||||
typedef unsigned long __kernel_size_t;
|
||||
typedef long __kernel_ssize_t;
|
||||
+typedef long __kernel_ptrdiff_t;
|
||||
#else
|
||||
typedef unsigned int __kernel_size_t;
|
||||
typedef int __kernel_ssize_t;
|
||||
-#endif
|
||||
typedef int __kernel_ptrdiff_t;
|
||||
+#endif
|
||||
typedef long __kernel_time_t;
|
||||
typedef long __kernel_suseconds_t;
|
||||
typedef long __kernel_clock_t;
|
||||
44
backport-CVE-2022-30767.patch
Normal file
44
backport-CVE-2022-30767.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From bdbf7a05e26f3c5fd437c99e2755ffde186ddc80 Mon Sep 17 00:00:00 2001
|
||||
From: Andrea zi0Black Cappa <zi0Black@protonmail.com>
|
||||
Date: Wed, 18 May 2022 16:30:08 +0000
|
||||
Subject: [PATCH] net: nfs: Fix CVE-2022-30767 (old CVE-2019-14196)
|
||||
|
||||
This patch mitigates the vulnerability identified via CVE-2019-14196.
|
||||
|
||||
The previous patch was bypassed/ineffective, and now the vulnerability
|
||||
is identified via CVE-2022-30767. The patch removes the sanity check
|
||||
introduced to mitigate CVE-2019-14196 since it's ineffective.
|
||||
filefh3_length is changed to unsigned type integer, preventing negative
|
||||
numbers from being used during comparison with positive values during
|
||||
size sanity checks.
|
||||
|
||||
Signed-off-by: Andrea zi0Black Cappa <zi0Black@protonmail.com>
|
||||
---
|
||||
net/nfs.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/net/nfs.c b/net/nfs.c
|
||||
index 3c01cebd96..9152ab742e 100644
|
||||
--- a/net/nfs.c
|
||||
+++ b/net/nfs.c
|
||||
@@ -52,7 +52,7 @@ static const ulong nfs_timeout = CONFIG_NFS_TIMEOUT;
|
||||
|
||||
static char dirfh[NFS_FHSIZE]; /* NFSv2 / NFSv3 file handle of directory */
|
||||
static char filefh[NFS3_FHSIZE]; /* NFSv2 / NFSv3 file handle */
|
||||
-static int filefh3_length; /* (variable) length of filefh when NFSv3 */
|
||||
+static unsigned int filefh3_length; /* (variable) length of filefh when NFSv3 */
|
||||
|
||||
static enum net_loop_state nfs_download_state;
|
||||
static struct in_addr nfs_server_ip;
|
||||
@@ -573,8 +573,6 @@ static int nfs_lookup_reply(uchar *pkt, unsigned len)
|
||||
filefh3_length = ntohl(rpc_pkt.u.reply.data[1]);
|
||||
if (filefh3_length > NFS3_FHSIZE)
|
||||
filefh3_length = NFS3_FHSIZE;
|
||||
- if (((uchar *)&(rpc_pkt.u.reply.data[0]) - (uchar *)(&rpc_pkt) + filefh3_length) > len)
|
||||
- return -NFS_RPC_DROP;
|
||||
memcpy(filefh, rpc_pkt.u.reply.data + 2, filefh3_length);
|
||||
}
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
||||
75
backport-CVE-2022-33103.patch
Normal file
75
backport-CVE-2022-33103.patch
Normal file
@ -0,0 +1,75 @@
|
||||
From 2ac0baab4aff1a0b45067d0b62f00c15f4e86856 Mon Sep 17 00:00:00 2001
|
||||
From: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Date: Thu, 9 Jun 2022 16:02:06 +0200
|
||||
Subject: [PATCH] fs/squashfs: sqfs_read: Prevent arbitrary code execution
|
||||
|
||||
Following Jincheng's report, an out-of-band write leading to arbitrary
|
||||
code execution is possible because on one side the squashfs logic
|
||||
accepts directory names up to 65535 bytes (u16), while U-Boot fs logic
|
||||
accepts directory names up to 255 bytes long.
|
||||
|
||||
Prevent such an exploit from happening by capping directory name sizes
|
||||
to 255. Use a define for this purpose so that developers can link the
|
||||
limitation to its source and eventually kill it some day by dynamically
|
||||
allocating this array (if ever desired).
|
||||
|
||||
Link: https://lore.kernel.org/all/CALO=DHFB+yBoXxVr5KcsK0iFdg+e7ywko4-e+72kjbcS8JBfPw@mail.gmail.com
|
||||
Reported-by: Jincheng Wang <jc.w4ng@gmail.com>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Tested-by: Jincheng Wang <jc.w4ng@gmail.com>
|
||||
---
|
||||
fs/squashfs/sqfs.c | 8 +++++---
|
||||
include/fs.h | 4 +++-
|
||||
2 files changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
|
||||
index 547d2fd4b30..b9f05efd9c9 100644
|
||||
--- a/fs/squashfs/sqfs.c
|
||||
+++ b/fs/squashfs/sqfs.c
|
||||
@@ -975,6 +975,7 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
|
||||
int i_number, offset = 0, ret;
|
||||
struct fs_dirent *dent;
|
||||
unsigned char *ipos;
|
||||
+ u16 name_size;
|
||||
|
||||
dirs = (struct squashfs_dir_stream *)fs_dirs;
|
||||
if (!dirs->size) {
|
||||
@@ -1057,9 +1058,10 @@ int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
|
||||
return -SQFS_STOP_READDIR;
|
||||
}
|
||||
|
||||
- /* Set entry name */
|
||||
- strncpy(dent->name, dirs->entry->name, dirs->entry->name_size + 1);
|
||||
- dent->name[dirs->entry->name_size + 1] = '\0';
|
||||
+ /* Set entry name (capped at FS_DIRENT_NAME_LEN which is a U-Boot limitation) */
|
||||
+ name_size = min_t(u16, dirs->entry->name_size + 1, FS_DIRENT_NAME_LEN - 1);
|
||||
+ strncpy(dent->name, dirs->entry->name, name_size);
|
||||
+ dent->name[name_size] = '\0';
|
||||
|
||||
offset = dirs->entry->name_size + 1 + SQFS_ENTRY_BASE_LENGTH;
|
||||
dirs->entry_count--;
|
||||
diff --git a/include/fs.h b/include/fs.h
|
||||
index b43f16a692f..2195dc172ec 100644
|
||||
--- a/include/fs.h
|
||||
+++ b/include/fs.h
|
||||
@@ -174,6 +174,8 @@ int fs_write(const char *filename, ulong addr, loff_t offset, loff_t len,
|
||||
#define FS_DT_REG 8 /* regular file */
|
||||
#define FS_DT_LNK 10 /* symbolic link */
|
||||
|
||||
+#define FS_DIRENT_NAME_LEN 256
|
||||
+
|
||||
/**
|
||||
* struct fs_dirent - directory entry
|
||||
*
|
||||
@@ -194,7 +196,7 @@ struct fs_dirent {
|
||||
/** change_time: time of last modification */
|
||||
struct rtc_time change_time;
|
||||
/** name: file name */
|
||||
- char name[256];
|
||||
+ char name[FS_DIRENT_NAME_LEN];
|
||||
};
|
||||
|
||||
/* Note: fs_dir_stream should be treated as opaque to the user of fs layer */
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
From 7f7fb9937c6cb49dd35153bd6708872b390b0a44 Mon Sep 17 00:00:00 2001
|
||||
From e40e9a32dd411f444d6e2ed73c517ee584a386ae Mon Sep 17 00:00:00 2001
|
||||
From: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Date: Mon, 27 Jun 2022 12:20:03 +0200
|
||||
Subject: [PATCH] fs/squashfs: Use kcalloc when relevant
|
||||
|
||||
Date: Wed, 20 Jul 2022 09:18:20 +0000
|
||||
Subject: [PATCH] fs/squashfs: Use kcalloc when relevant
|
||||
A crafted squashfs image could embed a huge number of empty metadata
|
||||
blocks in order to make the amount of malloc()'d memory overflow and be
|
||||
much smaller than expected. Because of this flaw, any random code
|
||||
@ -21,19 +20,13 @@ The right way to do it would be to enhance the calloc() implementation
|
||||
but this is quite an impacting change for such a small fix. Another
|
||||
solution would be to add the check before the malloc call in the
|
||||
squashfs implementation, but this does not look right. So for now, let's
|
||||
use the kcalloc() compatibility function from Linux, which has this
|
||||
check.
|
||||
|
||||
Fixes: c5100613037 ("fs/squashfs: new filesystem")
|
||||
Reported-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Tested-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
|
||||
use the kcalloc() compatibility function fro...
|
||||
---
|
||||
fs/squashfs/sqfs.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
|
||||
index 92ab8ac6..60557f4a 100644
|
||||
index 92ab8ac6..ef4b5836 100644
|
||||
--- a/fs/squashfs/sqfs.c
|
||||
+++ b/fs/squashfs/sqfs.c
|
||||
@@ -13,6 +13,7 @@
|
||||
@ -50,8 +43,10 @@ index 92ab8ac6..60557f4a 100644
|
||||
|
||||
- *inode_table = malloc(metablks_count * SQFS_METADATA_BLOCK_SIZE);
|
||||
+ *inode_table = kcalloc(metablks_count, SQFS_METADATA_BLOCK_SIZE,
|
||||
+ GFP_KERNEL);
|
||||
+ GFP_KERNEL);
|
||||
if (!*inode_table) {
|
||||
ret = -ENOMEM;
|
||||
goto free_itb;
|
||||
--
|
||||
--
|
||||
2.33.0
|
||||
|
||||
|
||||
40
backport-CVE-2024-57254.patch
Normal file
40
backport-CVE-2024-57254.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From c8e929e5758999933f9e905049ef2bf3fe6b140d Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 18:36:45 +0200
|
||||
Subject: [PATCH] squashfs: Fix integer overflow in sqfs_inode_size()
|
||||
|
||||
A carefully crafted squashfs filesystem can exhibit an extremly large
|
||||
inode size and overflow the calculation in sqfs_inode_size().
|
||||
As a consequence, the squashfs driver will read from wrong locations.
|
||||
|
||||
Fix by using __builtin_add_overflow() to detect the overflow.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
---
|
||||
fs/squashfs/sqfs_inode.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs_inode.c b/fs/squashfs/sqfs_inode.c
|
||||
index d25cfb53e75d..bb3ccd37e33b 100644
|
||||
--- a/fs/squashfs/sqfs_inode.c
|
||||
+++ b/fs/squashfs/sqfs_inode.c
|
||||
@@ -78,11 +78,16 @@ int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size)
|
||||
|
||||
case SQFS_SYMLINK_TYPE:
|
||||
case SQFS_LSYMLINK_TYPE: {
|
||||
+ int size;
|
||||
+
|
||||
struct squashfs_symlink_inode *symlink =
|
||||
(struct squashfs_symlink_inode *)inode;
|
||||
|
||||
- return sizeof(*symlink) +
|
||||
- get_unaligned_le32(&symlink->symlink_size);
|
||||
+ if (__builtin_add_overflow(sizeof(*symlink),
|
||||
+ get_unaligned_le32(&symlink->symlink_size), &size))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return size;
|
||||
}
|
||||
|
||||
case SQFS_BLKDEV_TYPE:
|
||||
46
backport-CVE-2024-57255.patch
Normal file
46
backport-CVE-2024-57255.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 233945eba63e24061dffeeaeb7cd6fe985278356 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 18:36:44 +0200
|
||||
Subject: [PATCH] squashfs: Fix integer overflow in sqfs_resolve_symlink()
|
||||
|
||||
A carefully crafted squashfs filesystem can exhibit an inode size of 0xffffffff,
|
||||
as a consequence malloc() will do a zero allocation.
|
||||
Later in the function the inode size is again used for copying data.
|
||||
So an attacker can overwrite memory.
|
||||
Avoid the overflow by using the __builtin_add_overflow() helper.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
---
|
||||
fs/squashfs/sqfs.c | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
|
||||
index 1430e671a5a8..16a07c0622bd 100644
|
||||
--- a/fs/squashfs/sqfs.c
|
||||
+++ b/fs/squashfs/sqfs.c
|
||||
@@ -422,8 +422,10 @@ static char *sqfs_resolve_symlink(struct squashfs_symlink_inode *sym,
|
||||
char *resolved, *target;
|
||||
u32 sz;
|
||||
|
||||
- sz = get_unaligned_le32(&sym->symlink_size);
|
||||
- target = malloc(sz + 1);
|
||||
+ if (__builtin_add_overflow(get_unaligned_le32(&sym->symlink_size), 1, &sz))
|
||||
+ return NULL;
|
||||
+
|
||||
+ target = malloc(sz);
|
||||
if (!target)
|
||||
return NULL;
|
||||
|
||||
@@ -431,9 +433,9 @@ static char *sqfs_resolve_symlink(struct squashfs_symlink_inode *sym,
|
||||
* There is no trailling null byte in the symlink's target path, so a
|
||||
* copy is made and a '\0' is added at its end.
|
||||
*/
|
||||
- target[sz] = '\0';
|
||||
+ target[sz - 1] = '\0';
|
||||
/* Get target name (relative path) */
|
||||
- strncpy(target, sym->symlink, sz);
|
||||
+ strncpy(target, sym->symlink, sz - 1);
|
||||
|
||||
/* Relative -> absolute path conversion */
|
||||
resolved = sqfs_get_abs_path(base_path, target);
|
||||
44
backport-CVE-2024-57256.patch
Normal file
44
backport-CVE-2024-57256.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 35f75d2a46e5859138c83a75cd2f4141c5479ab9 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 9 Aug 2024 11:54:28 +0200
|
||||
Subject: [PATCH] ext4: Fix integer overflow in ext4fs_read_symlink()
|
||||
|
||||
While zalloc() takes a size_t type, adding 1 to the le32 variable
|
||||
will overflow.
|
||||
A carefully crafted ext4 filesystem can exhibit an inode size of 0xffffffff
|
||||
and as consequence zalloc() will do a zero allocation.
|
||||
|
||||
Later in the function the inode size is again used for copying data.
|
||||
So an attacker can overwrite memory.
|
||||
|
||||
Avoid the overflow by using the __builtin_add_overflow() helper.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
fs/ext4/ext4_common.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
|
||||
index 7cf0160c408d..76f7102456e3 100644
|
||||
--- a/fs/ext4/ext4_common.c
|
||||
+++ b/fs/ext4/ext4_common.c
|
||||
@@ -2181,13 +2181,18 @@ static char *ext4fs_read_symlink(struct ext2fs_node *node)
|
||||
struct ext2fs_node *diro = node;
|
||||
int status;
|
||||
loff_t actread;
|
||||
+ size_t alloc_size;
|
||||
|
||||
if (!diro->inode_read) {
|
||||
status = ext4fs_read_inode(diro->data, diro->ino, &diro->inode);
|
||||
if (status == 0)
|
||||
return NULL;
|
||||
}
|
||||
- symlink = zalloc(le32_to_cpu(diro->inode.size) + 1);
|
||||
+
|
||||
+ if (__builtin_add_overflow(le32_to_cpu(diro->inode.size), 1, &alloc_size))
|
||||
+ return NULL;
|
||||
+
|
||||
+ symlink = zalloc(alloc_size);
|
||||
if (!symlink)
|
||||
return NULL;
|
||||
|
||||
220
backport-CVE-2024-57257.patch
Normal file
220
backport-CVE-2024-57257.patch
Normal file
@ -0,0 +1,220 @@
|
||||
From 4f5cc096bfd0a591f8a11e86999e3d90a9484c34 Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 18:36:47 +0200
|
||||
Subject: [PATCH] squashfs: Fix stack overflow while symlink resolving
|
||||
|
||||
The squashfs driver blindly follows symlinks, and calls sqfs_size()
|
||||
recursively. So an attacker can create a crafted filesystem and with
|
||||
a deep enough nesting level a stack overflow can be achieved.
|
||||
|
||||
Fix by limiting the nesting level to 8.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
---
|
||||
fs/squashfs/sqfs.c | 76 +++++++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 61 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
|
||||
index fa99d514f20f..af7ff80a7bdf 100644
|
||||
--- a/fs/squashfs/sqfs.c
|
||||
+++ b/fs/squashfs/sqfs.c
|
||||
@@ -24,7 +24,12 @@
|
||||
#include "sqfs_filesystem.h"
|
||||
#include "sqfs_utils.h"
|
||||
|
||||
+#define MAX_SYMLINK_NEST 8
|
||||
+
|
||||
static struct squashfs_ctxt ctxt;
|
||||
+static int symlinknest;
|
||||
+
|
||||
+static int sqfs_readdir_nest(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp);
|
||||
|
||||
static int sqfs_disk_read(__u32 block, __u32 nr_blocks, void *buf)
|
||||
{
|
||||
@@ -510,7 +515,7 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- while (!sqfs_readdir(dirsp, &dent)) {
|
||||
+ while (!sqfs_readdir_nest(dirsp, &dent)) {
|
||||
ret = strcmp(dent->name, token_list[j]);
|
||||
if (!ret)
|
||||
break;
|
||||
@@ -537,6 +542,11 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list,
|
||||
|
||||
/* Check for symbolic link and inode type sanity */
|
||||
if (get_unaligned_le16(&dir->inode_type) == SQFS_SYMLINK_TYPE) {
|
||||
+ if (++symlinknest == MAX_SYMLINK_NEST) {
|
||||
+ ret = -ELOOP;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
sym = (struct squashfs_symlink_inode *)table;
|
||||
/* Get first j + 1 tokens */
|
||||
path = sqfs_concat_tokens(token_list, j + 1);
|
||||
@@ -884,7 +894,7 @@ static int sqfs_read_directory_table(unsigned char **dir_table, u32 **pos_list)
|
||||
return metablks_count;
|
||||
}
|
||||
|
||||
-int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
|
||||
+static int sqfs_opendir_nest(const char *filename, struct fs_dir_stream **dirsp)
|
||||
{
|
||||
unsigned char *inode_table = NULL, *dir_table = NULL;
|
||||
int j, token_count = 0, ret = 0, metablks_count;
|
||||
@@ -979,7 +989,19 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
|
||||
+{
|
||||
+ symlinknest = 0;
|
||||
+ return sqfs_opendir_nest(filename, dirsp);
|
||||
+}
|
||||
+
|
||||
int sqfs_readdir(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
|
||||
+{
|
||||
+ symlinknest = 0;
|
||||
+ return sqfs_readdir_nest(fs_dirs, dentp);
|
||||
+}
|
||||
+
|
||||
+static int sqfs_readdir_nest(struct fs_dir_stream *fs_dirs, struct fs_dirent **dentp)
|
||||
{
|
||||
struct squashfs_super_block *sblk = ctxt.sblk;
|
||||
struct squashfs_dir_stream *dirs;
|
||||
@@ -1325,8 +1347,8 @@ static int sqfs_get_lregfile_info(struct squashfs_lreg_inode *lreg,
|
||||
return datablk_count;
|
||||
}
|
||||
|
||||
-int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
- loff_t *actread)
|
||||
+static int sqfs_read_nest(const char *filename, void *buf, loff_t offset,
|
||||
+ loff_t len, loff_t *actread)
|
||||
{
|
||||
char *dir = NULL, *fragment_block, *datablock = NULL;
|
||||
char *fragment = NULL, *file = NULL, *resolved, *data;
|
||||
@@ -1356,11 +1378,11 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
}
|
||||
|
||||
/*
|
||||
- * sqfs_opendir will uncompress inode and directory tables, and will
|
||||
+ * sqfs_opendir_nest will uncompress inode and directory tables, and will
|
||||
* return a pointer to the directory that contains the requested file.
|
||||
*/
|
||||
sqfs_split_path(&file, &dir, filename);
|
||||
- ret = sqfs_opendir(dir, &dirsp);
|
||||
+ ret = sqfs_opendir_nest(dir, &dirsp);
|
||||
if (ret) {
|
||||
goto out;
|
||||
}
|
||||
@@ -1368,7 +1390,7 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
dirs = (struct squashfs_dir_stream *)dirsp;
|
||||
|
||||
/* For now, only regular files are able to be loaded */
|
||||
- while (!sqfs_readdir(dirsp, &dent)) {
|
||||
+ while (!sqfs_readdir_nest(dirsp, &dent)) {
|
||||
ret = strcmp(dent->name, file);
|
||||
if (!ret)
|
||||
break;
|
||||
@@ -1421,9 +1443,14 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
break;
|
||||
case SQFS_SYMLINK_TYPE:
|
||||
case SQFS_LSYMLINK_TYPE:
|
||||
+ if (++symlinknest == MAX_SYMLINK_NEST) {
|
||||
+ ret = -ELOOP;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
symlink = (struct squashfs_symlink_inode *)ipos;
|
||||
resolved = sqfs_resolve_symlink(symlink, filename);
|
||||
- ret = sqfs_read(resolved, buf, offset, len, actread);
|
||||
+ ret = sqfs_read_nest(resolved, buf, offset, len, actread);
|
||||
free(resolved);
|
||||
goto out;
|
||||
case SQFS_BLKDEV_TYPE:
|
||||
@@ -1594,7 +1621,14 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int sqfs_size(const char *filename, loff_t *size)
|
||||
+int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
+ loff_t *actread)
|
||||
+{
|
||||
+ symlinknest = 0;
|
||||
+ return sqfs_read_nest(filename, buf, offset, len, actread);
|
||||
+}
|
||||
+
|
||||
+static int sqfs_size_nest(const char *filename, loff_t *size)
|
||||
{
|
||||
struct squashfs_super_block *sblk = ctxt.sblk;
|
||||
struct squashfs_symlink_inode *symlink;
|
||||
@@ -1610,10 +1644,10 @@ int sqfs_size(const char *filename, loff_t *size)
|
||||
|
||||
sqfs_split_path(&file, &dir, filename);
|
||||
/*
|
||||
- * sqfs_opendir will uncompress inode and directory tables, and will
|
||||
+ * sqfs_opendir_nest will uncompress inode and directory tables, and will
|
||||
* return a pointer to the directory that contains the requested file.
|
||||
*/
|
||||
- ret = sqfs_opendir(dir, &dirsp);
|
||||
+ ret = sqfs_opendir_nest(dir, &dirsp);
|
||||
if (ret) {
|
||||
ret = -EINVAL;
|
||||
goto free_strings;
|
||||
@@ -1621,7 +1655,7 @@ int sqfs_size(const char *filename, loff_t *size)
|
||||
|
||||
dirs = (struct squashfs_dir_stream *)dirsp;
|
||||
|
||||
- while (!sqfs_readdir(dirsp, &dent)) {
|
||||
+ while (!sqfs_readdir_nest(dirsp, &dent)) {
|
||||
ret = strcmp(dent->name, file);
|
||||
if (!ret)
|
||||
break;
|
||||
@@ -1661,6 +1695,11 @@ int sqfs_size(const char *filename, loff_t *size)
|
||||
break;
|
||||
case SQFS_SYMLINK_TYPE:
|
||||
case SQFS_LSYMLINK_TYPE:
|
||||
+ if (++symlinknest == MAX_SYMLINK_NEST) {
|
||||
+ *size = 0;
|
||||
+ return -ELOOP;
|
||||
+ }
|
||||
+
|
||||
symlink = (struct squashfs_symlink_inode *)ipos;
|
||||
resolved = sqfs_resolve_symlink(symlink, filename);
|
||||
ret = sqfs_size(resolved, size);
|
||||
@@ -1700,10 +1739,11 @@ int sqfs_exists(const char *filename)
|
||||
|
||||
sqfs_split_path(&file, &dir, filename);
|
||||
/*
|
||||
- * sqfs_opendir will uncompress inode and directory tables, and will
|
||||
+ * sqfs_opendir_nest will uncompress inode and directory tables, and will
|
||||
* return a pointer to the directory that contains the requested file.
|
||||
*/
|
||||
- ret = sqfs_opendir(dir, &dirsp);
|
||||
+ symlinknest = 0;
|
||||
+ ret = sqfs_opendir_nest(dir, &dirsp);
|
||||
if (ret) {
|
||||
ret = -EINVAL;
|
||||
goto free_strings;
|
||||
@@ -1711,7 +1751,7 @@ int sqfs_exists(const char *filename)
|
||||
|
||||
dirs = (struct squashfs_dir_stream *)dirsp;
|
||||
|
||||
- while (!sqfs_readdir(dirsp, &dent)) {
|
||||
+ while (!sqfs_readdir_nest(dirsp, &dent)) {
|
||||
ret = strcmp(dent->name, file);
|
||||
if (!ret)
|
||||
break;
|
||||
@@ -1728,6 +1768,12 @@ int sqfs_exists(const char *filename)
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
+int sqfs_size(const char *filename, loff_t *size)
|
||||
+{
|
||||
+ symlinknest = 0;
|
||||
+ return sqfs_size_nest(filename, size);
|
||||
+}
|
||||
+
|
||||
void sqfs_close(void)
|
||||
{
|
||||
sqfs_decompressor_cleanup(&ctxt);
|
||||
34
backport-CVE-2024-57259.patch
Normal file
34
backport-CVE-2024-57259.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 048d795bb5b3d9c5701b4855f5e74bcf6849bf5e Mon Sep 17 00:00:00 2001
|
||||
From: Richard Weinberger <richard@nod.at>
|
||||
Date: Fri, 2 Aug 2024 22:05:09 +0200
|
||||
Subject: [PATCH] squashfs: Fix heap corruption in sqfs_search_dir()
|
||||
|
||||
res needs to be large enough to store both strings rem and target,
|
||||
plus the path separator and the terminator.
|
||||
Currently the space for the path separator is not accounted, so
|
||||
the heap is corrupted by one byte.
|
||||
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
---
|
||||
fs/squashfs/sqfs.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
|
||||
index af7ff80a7bdf..b9314019b1bc 100644
|
||||
--- a/fs/squashfs/sqfs.c
|
||||
+++ b/fs/squashfs/sqfs.c
|
||||
@@ -567,8 +567,11 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list,
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
- /* Concatenate remaining tokens and symlink's target */
|
||||
- res = malloc(strlen(rem) + strlen(target) + 1);
|
||||
+ /*
|
||||
+ * Concatenate remaining tokens and symlink's target.
|
||||
+ * Allocate enough space for rem, target, '/' and '\0'.
|
||||
+ */
|
||||
+ res = malloc(strlen(rem) + strlen(target) + 2);
|
||||
if (!res) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: uboot-tools
|
||||
Version: 2021.10
|
||||
Release: 4
|
||||
Release: 10
|
||||
Summary: tools for U-Boot
|
||||
License: GPL-2.0-or-later and Public Domain and GPL-2.0-only
|
||||
URL: http://www.denx.de/wiki/U-Boot
|
||||
@ -20,11 +20,24 @@ Patch6001: backport-AllWinner-PineTab.patch
|
||||
# RPI4
|
||||
Patch6002: backport-rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
|
||||
Patch6003: backport-CVE-2022-34835.patch
|
||||
Patch6004: backport-CVE-2022-33967.patch
|
||||
Patch6004: backport-CVE-2022-33967.patch
|
||||
Patch6005: backport-CVE-2022-30767.patch
|
||||
Patch6006: backport-0001-CVE-2022-2347.patch
|
||||
Patch6007: backport-0002-CVE-2022-2347.patch
|
||||
Patch6008: backport-CVE-2024-57254.patch
|
||||
Patch6009: backport-CVE-2024-57255.patch
|
||||
Patch6010: backport-CVE-2024-57256.patch
|
||||
Patch6011: backport-CVE-2024-57257.patch
|
||||
Patch6012: backport-0001-CVE-2024-57258.patch
|
||||
Patch6013: backport-0002-CVE-2024-57258.patch
|
||||
Patch6014: backport-0003-CVE-2024-57258.patch
|
||||
Patch6015: backport-CVE-2024-57259.patch
|
||||
Patch6016: backport-CVE-2022-33103.patch
|
||||
|
||||
BuildRequires: bc dtc gcc make flex bison git-core openssl-devel
|
||||
BuildRequires: python3-unversioned-command python3-devel python3-setuptools
|
||||
BuildRequires: python3-libfdt python3-pyelftools SDL-devel swig
|
||||
BuildRequires: perl
|
||||
# this required when /usr/bin/python link to python3
|
||||
BuildRequires: python3-devel
|
||||
%if %{with_armv8}
|
||||
@ -243,15 +256,33 @@ cp -p board/warp7/README builds/docs/README.warp7
|
||||
%{_mandir}/man1/mkimage.1*
|
||||
|
||||
%changelog
|
||||
* Tue Jul 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021-10-4
|
||||
* Tue May 06 2025 lingsheng <lingsheng1@h-partners.com> - 2021.10-10
|
||||
- fix CVE-2022-33103
|
||||
|
||||
* Wed Feb 19 2025 lingsheng <lingsheng1@h-partners.com> - 2021.10-9
|
||||
- fix CVE-2024-57254 CVE-2024-57255 CVE-2024-57256 CVE-2024-57257 CVE-2024-57258 CVE-2024-57259
|
||||
|
||||
* Tue Sep 24 2024 lingsheng <lingsheng1@h-partners.com> - 2021.10-8
|
||||
- fix CVE-2022-2347
|
||||
|
||||
* Wed Sep 28 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021.10-7
|
||||
- fix CVE-2022-30767
|
||||
|
||||
* Wed Jul 20 2022 cenhuilin <cenhuilin@kylinos.cn> - 2021.10-6
|
||||
- fix CVE-2022-33967
|
||||
|
||||
* Tue Jul 12 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021-10-3
|
||||
* Tue Jul 12 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021.10-5
|
||||
- fix CVE-2022-34835
|
||||
|
||||
* Wed May 11 2022 liuyumeng <liuyumeng5@h-partners.com> - 2021-10-2
|
||||
* Wed May 11 2022 liuyumeng <liuyumeng5@h-partners.com> - 2021.10-4
|
||||
- fix license error
|
||||
|
||||
* Sat May 07 2022 liuyumeng <liuyumeng5@h-partners.com> - 2021.10-3
|
||||
- fix license error
|
||||
|
||||
* Wed Apr 13 2022 yangcheng <yangcheng87@h-partners.com> - 2021.10-2
|
||||
- Add perl buildrequires to resolve compilation error
|
||||
|
||||
* Mon Dec 6 2021 yangcheng <yangcheng87@huawei.com> - 2021.10-1
|
||||
- Upgrade to 2021.10
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user