Skip to content

Commit e3b120f

Browse files
committed
kernel: bump 5.15 to 5.15.169
Added patch: generic/backport-5.15/430-v6.3-udf-Allocate-name-buffer-in-directory-iterator-on-he.patch This patch fixes the following compile warning: ``` CC [M] fs/udf/namei.o fs/udf/namei.c: In function 'udf_rename': fs/udf/namei.c:878:1: error: the frame size of 1144 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] 878 | } | ^ cc1: all warnings being treated as errors make[7]: *** [scripts/Makefile.build:289: fs/udf/namei.o] Error 1 ``` Link: openwrt/openwrt#16882 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent b389c3d commit e3b120f

6 files changed

+142
-7
lines changed

include/kernel-5.15

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
LINUX_VERSION-5.15 = .168
2-
LINUX_KERNEL_HASH-5.15.168 = cfbebbd57456827013b97689aa3cad1fbfbe864dd80b0ecf16bb29990b38e17a
1+
LINUX_VERSION-5.15 = .169
2+
LINUX_KERNEL_HASH-5.15.169 = e618c6d845fd1bc89477508e8d084bbe791fc88bf7623adee2deb6ecb2275370
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Jan Kara <[email protected]>
3+
Date: Tue, 20 Dec 2022 12:38:45 +0100
4+
Subject: udf: Allocate name buffer in directory iterator on heap
5+
6+
commit 0aba4860b0d0216a1a300484ff536171894d49d8 upstream.
7+
8+
Currently we allocate name buffer in directory iterators (struct
9+
udf_fileident_iter) on stack. These structures are relatively large
10+
(some 360 bytes on 64-bit architectures). For udf_rename() which needs
11+
to keep three of these structures in parallel the stack usage becomes
12+
rather heavy - 1536 bytes in total. Allocate the name buffer in the
13+
iterator from heap to avoid excessive stack usage.
14+
15+
Link: https://lore.kernel.org/all/[email protected]
16+
Reported-by: kernel test robot <[email protected]>
17+
Signed-off-by: Jan Kara <[email protected]>
18+
[Add extra include linux/slab.h]
19+
Signed-off-by: Hauke Mehrtens <[email protected]>
20+
---
21+
fs/udf/directory.c | 24 ++++++++++++++++--------
22+
fs/udf/udfdecl.h | 2 +-
23+
2 files changed, 17 insertions(+), 9 deletions(-)
24+
25+
--- a/fs/udf/directory.c
26+
+++ b/fs/udf/directory.c
27+
@@ -19,6 +19,7 @@
28+
#include <linux/bio.h>
29+
#include <linux/crc-itu-t.h>
30+
#include <linux/iversion.h>
31+
+#include <linux/slab.h>
32+
33+
static int udf_verify_fi(struct udf_fileident_iter *iter)
34+
{
35+
@@ -248,9 +249,14 @@ int udf_fiiter_init(struct udf_fileident
36+
iter->elen = 0;
37+
iter->epos.bh = NULL;
38+
iter->name = NULL;
39+
+ iter->namebuf = kmalloc(UDF_NAME_LEN_CS0, GFP_KERNEL);
40+
+ if (!iter->namebuf)
41+
+ return -ENOMEM;
42+
43+
- if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
44+
- return udf_copy_fi(iter);
45+
+ if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
46+
+ err = udf_copy_fi(iter);
47+
+ goto out;
48+
+ }
49+
50+
if (inode_bmap(dir, iter->pos >> dir->i_blkbits, &iter->epos,
51+
&iter->eloc, &iter->elen, &iter->loffset) !=
52+
@@ -260,17 +266,17 @@ int udf_fiiter_init(struct udf_fileident
53+
udf_err(dir->i_sb,
54+
"position %llu not allocated in directory (ino %lu)\n",
55+
(unsigned long long)pos, dir->i_ino);
56+
- return -EFSCORRUPTED;
57+
+ err = -EFSCORRUPTED;
58+
+ goto out;
59+
}
60+
err = udf_fiiter_load_bhs(iter);
61+
if (err < 0)
62+
- return err;
63+
+ goto out;
64+
err = udf_copy_fi(iter);
65+
- if (err < 0) {
66+
+out:
67+
+ if (err < 0)
68+
udf_fiiter_release(iter);
69+
- return err;
70+
- }
71+
- return 0;
72+
+ return err;
73+
}
74+
75+
int udf_fiiter_advance(struct udf_fileident_iter *iter)
76+
@@ -307,6 +313,8 @@ void udf_fiiter_release(struct udf_filei
77+
brelse(iter->bh[0]);
78+
brelse(iter->bh[1]);
79+
iter->bh[0] = iter->bh[1] = NULL;
80+
+ kfree(iter->namebuf);
81+
+ iter->namebuf = NULL;
82+
}
83+
84+
static void udf_copy_to_bufs(void *buf1, int len1, void *buf2, int len2,
85+
--- a/fs/udf/udfdecl.h
86+
+++ b/fs/udf/udfdecl.h
87+
@@ -99,7 +99,7 @@ struct udf_fileident_iter {
88+
struct extent_position epos; /* Position after the above extent */
89+
struct fileIdentDesc fi; /* Copied directory entry */
90+
uint8_t *name; /* Pointer to entry name */
91+
- uint8_t namebuf[UDF_NAME_LEN_CS0]; /* Storage for entry name in case
92+
+ uint8_t *namebuf; /* Storage for entry name in case
93+
* the name is split between two blocks
94+
*/
95+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Jan Kara <[email protected]>
3+
Date: Thu, 9 Feb 2023 10:33:09 +0100
4+
Subject: udf: Avoid directory type conversion failure due to ENOMEM
5+
6+
commit df97f64dfa317a5485daf247b6c043a584ef95f9 upstream.
7+
8+
When converting directory from in-ICB to normal format, the last
9+
iteration through the directory fixing up directory enteries can fail
10+
due to ENOMEM. We do not expect this iteration to fail since the
11+
directory is already verified to be correct and it is difficult to undo
12+
the conversion at this point. So just use GFP_NOFAIL to make sure the
13+
small allocation cannot fail.
14+
15+
Reported-by: [email protected]
16+
Fixes: 0aba4860b0d0 ("udf: Allocate name buffer in directory iterator on heap")
17+
Signed-off-by: Jan Kara <[email protected]>
18+
Signed-off-by: Greg Kroah-Hartman <[email protected]>
19+
---
20+
fs/udf/directory.c | 9 ++++++---
21+
1 file changed, 6 insertions(+), 3 deletions(-)
22+
23+
--- a/fs/udf/directory.c
24+
+++ b/fs/udf/directory.c
25+
@@ -249,9 +249,12 @@ int udf_fiiter_init(struct udf_fileident
26+
iter->elen = 0;
27+
iter->epos.bh = NULL;
28+
iter->name = NULL;
29+
- iter->namebuf = kmalloc(UDF_NAME_LEN_CS0, GFP_KERNEL);
30+
- if (!iter->namebuf)
31+
- return -ENOMEM;
32+
+ /*
33+
+ * When directory is verified, we don't expect directory iteration to
34+
+ * fail and it can be difficult to undo without corrupting filesystem.
35+
+ * So just do not allow memory allocation failures here.
36+
+ */
37+
+ iter->namebuf = kmalloc(UDF_NAME_LEN_CS0, GFP_KERNEL | __GFP_NOFAIL);
38+
39+
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
40+
err = udf_copy_fi(iter);

target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann <[email protected]>
1717

1818
--- a/drivers/bluetooth/btusb.c
1919
+++ b/drivers/bluetooth/btusb.c
20-
@@ -2296,6 +2296,23 @@ struct btmtk_section_map {
20+
@@ -2301,6 +2301,23 @@ struct btmtk_section_map {
2121
};
2222
} __packed;
2323

@@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann <[email protected]>
4141
static void btusb_mtk_wmt_recv(struct urb *urb)
4242
{
4343
struct hci_dev *hdev = urb->context;
44-
@@ -3950,6 +3967,7 @@ static int btusb_probe(struct usb_interf
44+
@@ -3955,6 +3972,7 @@ static int btusb_probe(struct usb_interf
4545
hdev->shutdown = btusb_mtk_shutdown;
4646
hdev->manufacturer = 70;
4747
hdev->cmd_timeout = btusb_mtk_cmd_timeout;

target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann <[email protected]>
1818

1919
--- a/drivers/bluetooth/btusb.c
2020
+++ b/drivers/bluetooth/btusb.c
21-
@@ -2301,7 +2301,7 @@ static int btusb_set_bdaddr_mtk(struct h
21+
@@ -2306,7 +2306,7 @@ static int btusb_set_bdaddr_mtk(struct h
2222
struct sk_buff *skb;
2323
long ret;
2424

target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
4343

4444
#define QUECTEL_VENDOR_ID 0x2c7c
4545
/* These Quectel products use Quectel's vendor ID */
46-
@@ -1158,6 +1163,11 @@ static const struct usb_device_id option
46+
@@ -1159,6 +1164,11 @@ static const struct usb_device_id option
4747
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
4848
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
4949
.driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
@@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
5555
/* Quectel products using Qualcomm vendor ID */
5656
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
5757
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
58-
@@ -1199,6 +1209,11 @@ static const struct usb_device_id option
58+
@@ -1200,6 +1210,11 @@ static const struct usb_device_id option
5959
.driver_info = ZLP },
6060
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
6161
.driver_info = RSVD(4) },

0 commit comments

Comments
 (0)