From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Namjae Jeon <linkinjeon@kernel.org>,
Steve French <stfrench@microsoft.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.6.y 1/2] ksmbd: use __GFP_RETRY_MAYFAIL
Date: Sat, 12 Sep 2026 16:58:59 -0400 [thread overview]
Message-ID: <20260912205900.3933723-1-sashal@kernel.org> (raw)
In-Reply-To: <2026091124-spout-outward-c397@gregkh>
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 0066f623bce8f98b69b752ee03d46a5047c281b8 ]
Prefer to report ENOMEM rather than incur the oom for allocations in
ksmbd. __GFP_NORETRY could not achieve that, It would fail the allocations
just too easily. __GFP_RETRY_MAYFAIL will keep retrying the allocation
until there is no more progress and fail the allocation instead go OOM
and let the caller to deal with it.
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
[Stable dependency adaptation for 73f860489e3be2245598d1819226304fc5b87291]
Retain only the KSMBD_DEFAULT_GFP definition and its use for the existing
smb2_read_pipe() payload allocation. These two hunks provide the allocation
policy and exact patch context needed by "ksmbd: zero pipe read compound
padding" on Linux 6.6.
Drop the other allocation conversions, which are unrelated to the target.
This preserves the stable tree's IDA helper, RPC locking, preallocated lease
tables, ACL scratch sizing, and network-interface lifecycle changes instead
of importing obsolete upstream context. No functions are added. The target's
aligned allocation and padding initialization remain in the target commit.
[ sashal: Reduced backport -- upstream 0066f623bce8f touches 24 file(s), this
backport carries 2. Not backported here:
fs/smb/server/asn1.c
fs/smb/server/auth.c
fs/smb/server/connection.c
fs/smb/server/crypto_ctx.c
fs/smb/server/ksmbd_work.c
fs/smb/server/mgmt/ksmbd_ida.c
fs/smb/server/mgmt/share_config.c
fs/smb/server/mgmt/tree_connect.c
... and 14 more
This note is generated from the file lists only; see the resolution record
for the reasoning. ]
Stable-dep-of: 73f860489e3b ("ksmbd: zero pipe read compound padding")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/glob.h | 2 ++
fs/smb/server/smb2pdu.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/smb/server/glob.h b/fs/smb/server/glob.h
index 5b8f3e0ebdb36..3ce12b60e46fe 100644
--- a/fs/smb/server/glob.h
+++ b/fs/smb/server/glob.h
@@ -46,4 +46,6 @@ extern int ksmbd_debug_types;
#define UNICODE_LEN(x) ((x) * 2)
+#define KSMBD_DEFAULT_GFP (GFP_KERNEL | __GFP_RETRY_MAYFAIL)
+
#endif /* __KSMBD_GLOB_H */
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index d97ffe3d2a710..93185ea112014 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6717,7 +6717,7 @@ static noinline int smb2_read_pipe(struct ksmbd_work *work)
}
aux_payload_buf =
- kvmalloc(rpc_resp->payload_sz, GFP_KERNEL);
+ kvmalloc(rpc_resp->payload_sz, KSMBD_DEFAULT_GFP);
if (!aux_payload_buf) {
err = -ENOMEM;
goto out;
--
2.53.0
next prev parent reply other threads:[~2026-09-12 20:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 9:44 FAILED: patch "[PATCH] ksmbd: zero pipe read compound padding" failed to apply to 6.6-stable tree gregkh
2026-09-12 20:58 ` Sasha Levin [this message]
2026-09-12 20:59 ` [PATCH 6.6.y 2/2] ksmbd: zero pipe read compound padding Sasha Levin
-- strict thread matches above, loose matches on Subject: below --
2026-09-14 11:03 FAILED: patch "[PATCH] ksmbd: prevent out-of-bounds reads in share config responses" failed to apply to 6.6-stable tree gregkh
2026-09-14 14:39 ` [PATCH 6.6.y 1/2] ksmbd: use __GFP_RETRY_MAYFAIL Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260912205900.3933723-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linkinjeon@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stfrench@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox