From: Sasha Levin Date: Tue, 18 Mar 2025 00:58:38 +0000 (-0400) Subject: Fixes for 6.1 X-Git-Tag: v6.6.84~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6389a222bf2243e78e7433c88f746182c508124;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.1 Signed-off-by: Sasha Levin --- diff --git a/queue-6.1/arm64-mm-populate-vmemmap-at-the-page-level-if-not-s.patch b/queue-6.1/arm64-mm-populate-vmemmap-at-the-page-level-if-not-s.patch new file mode 100644 index 0000000000..392b12a07c --- /dev/null +++ b/queue-6.1/arm64-mm-populate-vmemmap-at-the-page-level-if-not-s.patch @@ -0,0 +1,67 @@ +From 0eb824f5b30cb4cc230a4e9da97597caaafd6fae Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 4 Mar 2025 15:27:00 +0800 +Subject: arm64: mm: Populate vmemmap at the page level if not section aligned + +From: Zhenhua Huang + +[ Upstream commit d4234d131b0a3f9e65973f1cdc71bb3560f5d14b ] + +On the arm64 platform with 4K base page config, SECTION_SIZE_BITS is set +to 27, making one section 128M. The related page struct which vmemmap +points to is 2M then. +Commit c1cc1552616d ("arm64: MMU initialisation") optimizes the +vmemmap to populate at the PMD section level which was suitable +initially since hot plug granule is always one section(128M). However, +commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") +introduced a 2M(SUBSECTION_SIZE) hot plug granule, which disrupted the +existing arm64 assumptions. + +The first problem is that if start or end is not aligned to a section +boundary, such as when a subsection is hot added, populating the entire +section is wasteful. + +The next problem is if we hotplug something that spans part of 128 MiB +section (subsections, let's call it memblock1), and then hotplug something +that spans another part of a 128 MiB section(subsections, let's call it +memblock2), and subsequently unplug memblock1, vmemmap_free() will clear +the entire PMD entry which also supports memblock2 even though memblock2 +is still active. + +Assuming hotplug/unplug sizes are guaranteed to be symmetric. Do the +fix similar to x86-64: populate to pages levels if start/end is not aligned +with section boundary. + +Cc: stable@vger.kernel.org # v5.4+ +Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") +Acked-by: David Hildenbrand +Signed-off-by: Zhenhua Huang +Reviewed-by: Oscar Salvador +Reviewed-by: Catalin Marinas +Link: https://lore.kernel.org/r/20250304072700.3405036-1-quic_zhenhuah@quicinc.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/mm/mmu.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c +index 6a4f118fb25f4..f095b99bb2144 100644 +--- a/arch/arm64/mm/mmu.c ++++ b/arch/arm64/mm/mmu.c +@@ -1209,8 +1209,11 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, + pmd_t *pmdp; + + WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END)); ++ /* [start, end] should be within one section */ ++ WARN_ON_ONCE(end - start > PAGES_PER_SECTION * sizeof(struct page)); + +- if (!ARM64_KERNEL_USES_PMD_MAPS) ++ if (!ARM64_KERNEL_USES_PMD_MAPS || ++ (end - start < PAGES_PER_SECTION * sizeof(struct page))) + return vmemmap_populate_basepages(start, end, node, altmap); + + do { +-- +2.39.5 + diff --git a/queue-6.1/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch b/queue-6.1/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch new file mode 100644 index 0000000000..35d9f73f0a --- /dev/null +++ b/queue-6.1/i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch @@ -0,0 +1,55 @@ +From b484f4fe89658b5d34d9214c46aa5bb5ee3b44ab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Mar 2025 20:53:08 +0100 +Subject: i2c: ali1535: Fix an error handling path in ali1535_probe() + +From: Christophe JAILLET + +[ Upstream commit 9b5463f349d019a261f1e80803447efca3126151 ] + +If i2c_add_adapter() fails, the request_region() call in ali1535_setup() +must be undone by a corresponding release_region() call, as done in the +remove function. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Christophe JAILLET +Signed-off-by: Andi Shyti +Link: https://lore.kernel.org/r/0daf63d7a2ce74c02e2664ba805bbfadab7d25e5.1741031571.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-ali1535.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c +index ee83c4581bce0..cd2c8afebe798 100644 +--- a/drivers/i2c/busses/i2c-ali1535.c ++++ b/drivers/i2c/busses/i2c-ali1535.c +@@ -490,6 +490,8 @@ MODULE_DEVICE_TABLE(pci, ali1535_ids); + + static int ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id) + { ++ int ret; ++ + if (ali1535_setup(dev)) { + dev_warn(&dev->dev, + "ALI1535 not detected, module not inserted.\n"); +@@ -501,7 +503,15 @@ static int ali1535_probe(struct pci_dev *dev, const struct pci_device_id *id) + + snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name), + "SMBus ALI1535 adapter at %04x", ali1535_offset); +- return i2c_add_adapter(&ali1535_adapter); ++ ret = i2c_add_adapter(&ali1535_adapter); ++ if (ret) ++ goto release_region; ++ ++ return 0; ++ ++release_region: ++ release_region(ali1535_smba, ALI1535_SMB_IOSIZE); ++ return ret; + } + + static void ali1535_remove(struct pci_dev *dev) +-- +2.39.5 + diff --git a/queue-6.1/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch b/queue-6.1/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch new file mode 100644 index 0000000000..909b876344 --- /dev/null +++ b/queue-6.1/i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch @@ -0,0 +1,55 @@ +From 065f31e8c7d65ab15beb17bcc957069bb12fd3c7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Mar 2025 20:58:06 +0100 +Subject: i2c: ali15x3: Fix an error handling path in ali15x3_probe() + +From: Christophe JAILLET + +[ Upstream commit 6e55caaf30c88209d097e575a169b1dface1ab69 ] + +If i2c_add_adapter() fails, the request_region() call in ali15x3_setup() +must be undone by a corresponding release_region() call, as done in the +remove function. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Christophe JAILLET +Signed-off-by: Andi Shyti +Link: https://lore.kernel.org/r/9b2090cbcc02659f425188ea05f2e02745c4e67b.1741031878.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-ali15x3.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c +index cc58feacd0821..28a57cb6efb99 100644 +--- a/drivers/i2c/busses/i2c-ali15x3.c ++++ b/drivers/i2c/busses/i2c-ali15x3.c +@@ -473,6 +473,8 @@ MODULE_DEVICE_TABLE (pci, ali15x3_ids); + + static int ali15x3_probe(struct pci_dev *dev, const struct pci_device_id *id) + { ++ int ret; ++ + if (ali15x3_setup(dev)) { + dev_err(&dev->dev, + "ALI15X3 not detected, module not inserted.\n"); +@@ -484,7 +486,15 @@ static int ali15x3_probe(struct pci_dev *dev, const struct pci_device_id *id) + + snprintf(ali15x3_adapter.name, sizeof(ali15x3_adapter.name), + "SMBus ALI15X3 adapter at %04x", ali15x3_smba); +- return i2c_add_adapter(&ali15x3_adapter); ++ ret = i2c_add_adapter(&ali15x3_adapter); ++ if (ret) ++ goto release_region; ++ ++ return 0; ++ ++release_region: ++ release_region(ali15x3_smba, ALI15X3_SMB_IOSIZE); ++ return ret; + } + + static void ali15x3_remove(struct pci_dev *dev) +-- +2.39.5 + diff --git a/queue-6.1/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch b/queue-6.1/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch new file mode 100644 index 0000000000..df85b09953 --- /dev/null +++ b/queue-6.1/i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch @@ -0,0 +1,55 @@ +From 4408d30c282c3b1ffda5f46a3cd653bbdc8146e5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 3 Mar 2025 21:26:54 +0100 +Subject: i2c: sis630: Fix an error handling path in sis630_probe() + +From: Christophe JAILLET + +[ Upstream commit 2b22459792fcb4def9f0936d64575ac11a95a58d ] + +If i2c_add_adapter() fails, the request_region() call in sis630_setup() +must be undone by a corresponding release_region() call, as done in the +remove function. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Christophe JAILLET +Link: https://lore.kernel.org/r/3d607601f2c38e896b10207963c6ab499ca5c307.1741033587.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-sis630.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c +index 87d56250d78a3..c42ecadac4f22 100644 +--- a/drivers/i2c/busses/i2c-sis630.c ++++ b/drivers/i2c/busses/i2c-sis630.c +@@ -509,6 +509,8 @@ MODULE_DEVICE_TABLE(pci, sis630_ids); + + static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id) + { ++ int ret; ++ + if (sis630_setup(dev)) { + dev_err(&dev->dev, + "SIS630 compatible bus not detected, " +@@ -522,7 +524,15 @@ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id) + snprintf(sis630_adapter.name, sizeof(sis630_adapter.name), + "SMBus SIS630 adapter at %04x", smbus_base + SMB_STS); + +- return i2c_add_adapter(&sis630_adapter); ++ ret = i2c_add_adapter(&sis630_adapter); ++ if (ret) ++ goto release_region; ++ ++ return 0; ++ ++release_region: ++ release_region(smbus_base + SMB_STS, SIS630_SMB_IOREGION); ++ return ret; + } + + static void sis630_remove(struct pci_dev *dev) +-- +2.39.5 + diff --git a/queue-6.1/series b/queue-6.1/series index af16c1b39d..4e3640424f 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -137,3 +137,9 @@ cifs-fix-integer-overflow-while-processing-acregmax-.patch cifs-fix-integer-overflow-while-processing-acdirmax-.patch cifs-fix-integer-overflow-while-processing-actimeo-m.patch cifs-fix-integer-overflow-while-processing-closetime.patch +i2c-ali1535-fix-an-error-handling-path-in-ali1535_pr.patch +i2c-ali15x3-fix-an-error-handling-path-in-ali15x3_pr.patch +i2c-sis630-fix-an-error-handling-path-in-sis630_prob.patch +arm64-mm-populate-vmemmap-at-the-page-level-if-not-s.patch +smb3-add-support-for-iakerb.patch +smb-client-fix-match_session-bug-preventing-session-.patch diff --git a/queue-6.1/smb-client-fix-match_session-bug-preventing-session-.patch b/queue-6.1/smb-client-fix-match_session-bug-preventing-session-.patch new file mode 100644 index 0000000000..c559640663 --- /dev/null +++ b/queue-6.1/smb-client-fix-match_session-bug-preventing-session-.patch @@ -0,0 +1,72 @@ +From d4942cd6ac83266fd73efbbcea3d06fdaf0849a4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Mar 2025 15:23:59 -0300 +Subject: smb: client: Fix match_session bug preventing session reuse + +From: Henrique Carvalho + +[ Upstream commit 605b249ea96770ac4fac4b8510a99e0f8442be5e ] + +Fix a bug in match_session() that can causes the session to not be +reused in some cases. + +Reproduction steps: + +mount.cifs //server/share /mnt/a -o credentials=creds +mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp +cat /proc/fs/cifs/DebugData | grep SessionId | wc -l + +mount.cifs //server/share /mnt/b -o credentials=creds,sec=ntlmssp +mount.cifs //server/share /mnt/a -o credentials=creds +cat /proc/fs/cifs/DebugData | grep SessionId | wc -l + +Cc: stable@vger.kernel.org +Reviewed-by: Enzo Matsumiya +Signed-off-by: Henrique Carvalho +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/client/connect.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c +index db30c4b8a2211..01ce81f77e891 100644 +--- a/fs/smb/client/connect.c ++++ b/fs/smb/client/connect.c +@@ -1881,9 +1881,8 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx, + /* this function must be called with ses_lock and chan_lock held */ + static int match_session(struct cifs_ses *ses, struct smb3_fs_context *ctx) + { +- if (ctx->sectype != Unspecified && +- ctx->sectype != ses->sectype) +- return 0; ++ struct TCP_Server_Info *server = ses->server; ++ enum securityEnum ctx_sec, ses_sec; + + /* + * If an existing session is limited to less channels than +@@ -1892,11 +1891,20 @@ static int match_session(struct cifs_ses *ses, struct smb3_fs_context *ctx) + if (ses->chan_max < ctx->max_channels) + return 0; + +- switch (ses->sectype) { ++ ctx_sec = server->ops->select_sectype(server, ctx->sectype); ++ ses_sec = server->ops->select_sectype(server, ses->sectype); ++ ++ if (ctx_sec != ses_sec) ++ return 0; ++ ++ switch (ctx_sec) { ++ case IAKerb: + case Kerberos: + if (!uid_eq(ctx->cred_uid, ses->cred_uid)) + return 0; + break; ++ case NTLMv2: ++ case RawNTLMSSP: + default: + /* NULL username means anonymous session */ + if (ses->user_name == NULL) { +-- +2.39.5 + diff --git a/queue-6.1/smb3-add-support-for-iakerb.patch b/queue-6.1/smb3-add-support-for-iakerb.patch new file mode 100644 index 0000000000..bb54b3df77 --- /dev/null +++ b/queue-6.1/smb3-add-support-for-iakerb.patch @@ -0,0 +1,124 @@ +From 5eddd6974a16bcfecd67cfb1aeef0fc4303d860f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 28 Jan 2025 01:04:23 -0600 +Subject: smb3: add support for IAKerb + +From: Steve French + +[ Upstream commit eea5119fa5979c350af5783a8148eacdd4219715 ] + +There are now more servers which advertise support for IAKerb (passthrough +Kerberos authentication via proxy). IAKerb is a public extension industry +standard Kerberos protocol that allows a client without line-of-sight +to a Domain Controller to authenticate. There can be cases where we +would fail to mount if the server only advertises the OID for IAKerb +in SPNEGO/GSSAPI. Add code to allow us to still upcall to userspace +in these cases to obtain the Kerberos ticket. + +Signed-off-by: Steve French +Stable-dep-of: 605b249ea967 ("smb: client: Fix match_session bug preventing session reuse") +Signed-off-by: Sasha Levin +--- + fs/smb/client/asn1.c | 2 ++ + fs/smb/client/cifs_spnego.c | 4 +++- + fs/smb/client/cifsglob.h | 4 ++++ + fs/smb/client/sess.c | 3 ++- + fs/smb/client/smb2pdu.c | 2 +- + 5 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/fs/smb/client/asn1.c b/fs/smb/client/asn1.c +index b5724ef9f182f..214a44509e7b9 100644 +--- a/fs/smb/client/asn1.c ++++ b/fs/smb/client/asn1.c +@@ -52,6 +52,8 @@ int cifs_neg_token_init_mech_type(void *context, size_t hdrlen, + server->sec_kerberos = true; + else if (oid == OID_ntlmssp) + server->sec_ntlmssp = true; ++ else if (oid == OID_IAKerb) ++ server->sec_iakerb = true; + else { + char buf[50]; + +diff --git a/fs/smb/client/cifs_spnego.c b/fs/smb/client/cifs_spnego.c +index 1e6819daaaa7e..8b58f494235ff 100644 +--- a/fs/smb/client/cifs_spnego.c ++++ b/fs/smb/client/cifs_spnego.c +@@ -130,11 +130,13 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo, + + dp = description + strlen(description); + +- /* for now, only sec=krb5 and sec=mskrb5 are valid */ ++ /* for now, only sec=krb5 and sec=mskrb5 and iakerb are valid */ + if (server->sec_kerberos) + sprintf(dp, ";sec=krb5"); + else if (server->sec_mskerberos) + sprintf(dp, ";sec=mskrb5"); ++ else if (server->sec_iakerb) ++ sprintf(dp, ";sec=iakerb"); + else { + cifs_dbg(VFS, "unknown or missing server auth type, use krb5\n"); + sprintf(dp, ";sec=krb5"); +diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h +index 71e519bf65e26..17fce0afb297f 100644 +--- a/fs/smb/client/cifsglob.h ++++ b/fs/smb/client/cifsglob.h +@@ -148,6 +148,7 @@ enum securityEnum { + NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */ + RawNTLMSSP, /* NTLMSSP without SPNEGO, NTLMv2 hash */ + Kerberos, /* Kerberos via SPNEGO */ ++ IAKerb, /* Kerberos proxy */ + }; + + struct session_key { +@@ -685,6 +686,7 @@ struct TCP_Server_Info { + bool sec_kerberosu2u; /* supports U2U Kerberos */ + bool sec_kerberos; /* supports plain Kerberos */ + bool sec_mskerberos; /* supports legacy MS Kerberos */ ++ bool sec_iakerb; /* supports pass-through auth for Kerberos (krb5 proxy) */ + bool large_buf; /* is current buffer large? */ + /* use SMBD connection instead of socket */ + bool rdma; +@@ -2049,6 +2051,8 @@ static inline char *get_security_type_str(enum securityEnum sectype) + return "Kerberos"; + case NTLMv2: + return "NTLMv2"; ++ case IAKerb: ++ return "IAKerb"; + default: + return "Unknown"; + } +diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c +index b8e14bcd2c68d..c8f7ae0a20064 100644 +--- a/fs/smb/client/sess.c ++++ b/fs/smb/client/sess.c +@@ -1209,12 +1209,13 @@ cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested) + switch (requested) { + case Kerberos: + case RawNTLMSSP: ++ case IAKerb: + return requested; + case Unspecified: + if (server->sec_ntlmssp && + (global_secflags & CIFSSEC_MAY_NTLMSSP)) + return RawNTLMSSP; +- if ((server->sec_kerberos || server->sec_mskerberos) && ++ if ((server->sec_kerberos || server->sec_mskerberos || server->sec_iakerb) && + (global_secflags & CIFSSEC_MAY_KRB5)) + return Kerberos; + fallthrough; +diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c +index 0ae931e023cee..96faa22b9cb6a 100644 +--- a/fs/smb/client/smb2pdu.c ++++ b/fs/smb/client/smb2pdu.c +@@ -1270,7 +1270,7 @@ smb2_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested) + if (server->sec_ntlmssp && + (global_secflags & CIFSSEC_MAY_NTLMSSP)) + return RawNTLMSSP; +- if ((server->sec_kerberos || server->sec_mskerberos) && ++ if ((server->sec_kerberos || server->sec_mskerberos || server->sec_iakerb) && + (global_secflags & CIFSSEC_MAY_KRB5)) + return Kerberos; + fallthrough; +-- +2.39.5 +