From patchwork Fri Jul 28 19:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A40C001DE for ; Fri, 28 Jul 2023 19:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234811AbjG1TuY (ORCPT ); Fri, 28 Jul 2023 15:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234074AbjG1TuX (ORCPT ); Fri, 28 Jul 2023 15:50:23 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9410A3C07 for ; Fri, 28 Jul 2023 12:50:21 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=j2C3J9Tk0XRUlrb5yZy7WpiLI7CrUDLjmpi4rmr4xPI=; b=qmKugTYsolR7iA43mUN+X0r0indjJBhNkiftkIpD1EC2F4nJ4m1tjHvLW8FPkMdAdJogRm MfnQRegUtp8Jf1+ZFYyp7MQqeXgUU3h/jFYM10fbOpkceSvRVdR8N+JKPIpiLKfvmkimVJ L1ltIviTT+H1tdLbxr7DTFMa5nWeOOveTFunRsy/CNW1FbTWhvZDx5Ln4Hr3Qq4aXIqqfF QzoFETfM3IAXVDJDcFtl6SR+4Jp74EAOrI5sGsgqnqonX28HDAyxY6MhrPcfXRK9OFdt2a 4S92ITjseau9jxA/gFZmZWrn1daldUGAFI2Lgd2PvITDtCrvS6+KKLCjUNco7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=j2C3J9Tk0XRUlrb5yZy7WpiLI7CrUDLjmpi4rmr4xPI=; b=dTguExKjj5oTst43aeaV9mNaw3HyLlONil8MsLsGAZd8PiNe8+I40di+cT+dQ++CWRsc/c ZG9PZX6PydFVQmhTI9/xuCLw2JgaBpy3b/voIpSP21/1NhB8gOWFVB496BfzOd4NacfkCL L8S3/CxnXvV7IPeHc+6pFl3EPYff2q0p9uEEqQXg9toOOnF6TfhnIFZquyRyGpAIL6+2HI 07oCbVRWaH63NiTiseOslPRfiVygAD990d/2ZkbbrqEOz+hK8nFg8RAQ0lIkV0VjeEn6TL +x+75VYArPQhz5rgq4qXpX4tSRqSEQzxWnWZpnRVFswAQEMM0PZMFMIdGvjexg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573819; a=rsa-sha256; cv=none; b=k6WW7fzQ000tUnyJRnBYrf3bwlTW1lXa9tuFVLn7o6408uxqS76hD+x6iw7JxR0srg3jVD pE9DuLc+mChaR/3GiReakaLsx+LN1zhzgqR6hAAsKFM/7Jy4mrkh+gHQM1jHGpsIXmj/Ha smN3KPq2XukDPwkLtqK4wqMnXg9zLw++jeBkcPC1Jk1u7a6aJnerkyN5IgGMz5Po10uVvo yTRAO/ET8VxNf9CP2t4YfBxTfsdk2TNl7JzOQ0QaRtxGQHtafweYqnO1e6FO+oNg7iRFLK s5fLn3DtLD02v8w6PWB1SWS+GnyD1MesOLz204b5GRTzNpsAekbyaBl6nWtCfw== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara , kernel test robot Subject: [PATCH 1/8] smb: client: reduce stack usage in cifs_try_adding_channels() Date: Fri, 28 Jul 2023 16:50:03 -0300 Message-ID: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/sess.c:160:5: warning: stack frame size (1368) exceeds limit (1024) in 'cifs_try_adding_channels' [-Wframe-larger-than] It turns out that cifs_ses_add_channel() got inlined into cifs_try_adding_channels() which had a stack-allocated variable @ctx of 624 bytes in size. Fix this by making it heap-allocated. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307270640.5ODmPwDl-lkp@intel.com/ Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/sess.c | 68 ++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index c57ca2050b73..5292216d9947 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -360,11 +360,11 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, { struct TCP_Server_Info *chan_server; struct cifs_chan *chan; - struct smb3_fs_context ctx = {NULL}; + struct smb3_fs_context *ctx; static const char unc_fmt[] = "\\%s\\foo"; - char unc[sizeof(unc_fmt)+SERVER_NAME_LEN_WITH_NULL] = {0}; struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr; struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; + size_t len; int rc; unsigned int xid = get_xid(); @@ -388,54 +388,64 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, * the session and server without caring about memory * management. */ + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + if (!ctx) { + rc = -ENOMEM; + goto out_free_xid; + } /* Always make new connection for now (TODO?) */ - ctx.nosharesock = true; + ctx->nosharesock = true; /* Auth */ - ctx.domainauto = ses->domainAuto; - ctx.domainname = ses->domainName; + ctx->domainauto = ses->domainAuto; + ctx->domainname = ses->domainName; /* no hostname for extra channels */ - ctx.server_hostname = ""; + ctx->server_hostname = ""; - ctx.username = ses->user_name; - ctx.password = ses->password; - ctx.sectype = ses->sectype; - ctx.sign = ses->sign; + ctx->username = ses->user_name; + ctx->password = ses->password; + ctx->sectype = ses->sectype; + ctx->sign = ses->sign; /* UNC and paths */ /* XXX: Use ses->server->hostname? */ - sprintf(unc, unc_fmt, ses->ip_addr); - ctx.UNC = unc; - ctx.prepath = ""; + len = sizeof(unc_fmt) + SERVER_NAME_LEN_WITH_NULL; + ctx->UNC = kzalloc(len, GFP_KERNEL); + if (!ctx->UNC) { + rc = -ENOMEM; + goto out_free_ctx; + } + scnprintf(ctx->UNC, len, unc_fmt, ses->ip_addr); + ctx->prepath = ""; /* Reuse same version as master connection */ - ctx.vals = ses->server->vals; - ctx.ops = ses->server->ops; + ctx->vals = ses->server->vals; + ctx->ops = ses->server->ops; - ctx.noblocksnd = ses->server->noblocksnd; - ctx.noautotune = ses->server->noautotune; - ctx.sockopt_tcp_nodelay = ses->server->tcp_nodelay; - ctx.echo_interval = ses->server->echo_interval / HZ; - ctx.max_credits = ses->server->max_credits; + ctx->noblocksnd = ses->server->noblocksnd; + ctx->noautotune = ses->server->noautotune; + ctx->sockopt_tcp_nodelay = ses->server->tcp_nodelay; + ctx->echo_interval = ses->server->echo_interval / HZ; + ctx->max_credits = ses->server->max_credits; /* * This will be used for encoding/decoding user/domain/pw * during sess setup auth. */ - ctx.local_nls = cifs_sb->local_nls; + ctx->local_nls = cifs_sb->local_nls; /* Use RDMA if possible */ - ctx.rdma = iface->rdma_capable; - memcpy(&ctx.dstaddr, &iface->sockaddr, sizeof(struct sockaddr_storage)); + ctx->rdma = iface->rdma_capable; + memcpy(&ctx->dstaddr, &iface->sockaddr, sizeof(ctx->dstaddr)); /* reuse master con client guid */ - memcpy(&ctx.client_guid, ses->server->client_guid, - SMB2_CLIENT_GUID_SIZE); - ctx.use_client_guid = true; + memcpy(&ctx->client_guid, ses->server->client_guid, + sizeof(ctx->client_guid)); + ctx->use_client_guid = true; - chan_server = cifs_get_tcp_session(&ctx, ses->server); + chan_server = cifs_get_tcp_session(ctx, ses->server); spin_lock(&ses->chan_lock); chan = &ses->chans[ses->chan_count]; @@ -497,6 +507,10 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses, cifs_put_tcp_session(chan->server, 0); } + kfree(ctx->UNC); +out_free_ctx: + kfree(ctx); +out_free_xid: free_xid(xid); return rc; } From patchwork Fri Jul 28 19:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F14F7C001DF for ; Fri, 28 Jul 2023 19:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbjG1TuY (ORCPT ); Fri, 28 Jul 2023 15:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234290AbjG1TuX (ORCPT ); Fri, 28 Jul 2023 15:50:23 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E74420F for ; Fri, 28 Jul 2023 12:50:22 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lTjDRReiGjyTPvMeCsJB3obpBf0aVkmd6MiO7iIGZ0Q=; b=Lwu6WayQMhUAE4lf9yLEAhTB3e0PrlsVQfHShCSgzbcwdvTdIn6ndMfBdqdzKrYGlI5Qlz jnm/N7DugEtq9WFmB8oXlYACXxhDb+uudQ5YPIZXD/zR43zTHfIhDwu0lKyoymhF7GOnVL CAdH5V74FCQkTVAdzDd/BQh8j+dgnDb61pr4LAMS+CZdyRu3W5IoE3Q3LgikAetPFieGT9 8nlu/yKKnjjbG4FvXJZTpIAaXhRJo3b3K7VZzyaUsS/e6qg+2LxZ7THyUPGf3muqsGDE+p X0GjkFYsRcN6DPmFzXnLL756FBrPsCNphAmSgjwhIBG/4tOdSfkOUYvT0pGRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lTjDRReiGjyTPvMeCsJB3obpBf0aVkmd6MiO7iIGZ0Q=; b=q8sCaPmYHQso24SwyZWUsaCi7qF3cQeSVlvT3SOC0FKI1xYh/JSMPA3cj4pyamXIOQQqKL 0n68IU2r85GRF/HjV9w7RzxyJfY9Xdh2yeL66qGDDQaaQh5qZnAS6miTgGbTp7WSdhBTQC Ud1zlA/g0P1Kicww5RDiIXGRXHBCUYtWhks2kceUnIkUHMdNG0CINnpWWYTunoRZos9OUX ZiTgzNSnvy2uASh2v7ke4oxpUyP4fm1jldclxy2p68jZ/WQFkip5KTb8X+YO6neSLL4UJa aAdvhN4IYLT9Kt8t1NNAMzTY7j9h0iSNCh0OSLMKDYIGEvWOUBaNz23i32Um2Q== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573821; a=rsa-sha256; cv=none; b=U7XJMFJybny7jGT4MdQLGOkMDZ8fX50etqg1IpavuFmPRzZEVo6XWxdM9bQQEJ25XYv8cG hZhSu+/nrUYrMvw8r0qRFyLGvBFDYTHfCJmEW+yGGWdU7BC+AmwqKKLqt5QF3OBaq3itGT tBNe9AzWRsTNocF7Pg5LsMDA1sVtllOfCpjcxjseD3eSoIDFpPy8yyPCQseidx+geLO9r5 2WPhJQPpqeeCgf7lZiDvof/B7PXrroKuvMeXLb/H15APgAbAk8R5hR5E8rhmbPhiUIFHad Kl+IvnEqAQife+nXYRFhW5EoHAnFrMxmqqL6pWjRfyTc0W4i8166G6zrO36g0w== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 2/8] smb: client: reduce stack usage in smb_send_rqst() Date: Fri, 28 Jul 2023 16:50:04 -0300 Message-ID: <20230728195010.19122-2-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/transport.c:420:1: warning: stack frame size (1048) exceeds limit (1024) in 'smb_send_rqst' [-Wframe-larger-than] Fix this by allocating a structure that will hold transform header and compound requests. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/transport.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c index f280502a2aee..1b5d9794ed5b 100644 --- a/fs/smb/client/transport.c +++ b/fs/smb/client/transport.c @@ -416,13 +416,19 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, return rc; } +struct send_req_vars { + struct smb2_transform_hdr tr_hdr; + struct smb_rqst rqst[MAX_COMPOUND]; + struct kvec iov; +}; + static int smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, struct smb_rqst *rqst, int flags) { - struct kvec iov; - struct smb2_transform_hdr *tr_hdr; - struct smb_rqst cur_rqst[MAX_COMPOUND]; + struct send_req_vars *vars; + struct smb_rqst *cur_rqst; + struct kvec *iov; int rc; if (!(flags & CIFS_TRANSFORM_REQ)) @@ -436,16 +442,15 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, return -EIO; } - tr_hdr = kzalloc(sizeof(*tr_hdr), GFP_NOFS); - if (!tr_hdr) + vars = kzalloc(sizeof(*vars), GFP_NOFS); + if (!vars) return -ENOMEM; + cur_rqst = vars->rqst; + iov = &vars->iov; - memset(&cur_rqst[0], 0, sizeof(cur_rqst)); - memset(&iov, 0, sizeof(iov)); - - iov.iov_base = tr_hdr; - iov.iov_len = sizeof(*tr_hdr); - cur_rqst[0].rq_iov = &iov; + iov->iov_base = &vars->tr_hdr; + iov->iov_len = sizeof(vars->tr_hdr); + cur_rqst[0].rq_iov = iov; cur_rqst[0].rq_nvec = 1; rc = server->ops->init_transform_rq(server, num_rqst + 1, @@ -456,7 +461,7 @@ smb_send_rqst(struct TCP_Server_Info *server, int num_rqst, rc = __smb_send_rqst(server, num_rqst + 1, &cur_rqst[0]); smb3_free_compound_rqst(num_rqst, &cur_rqst[1]); out: - kfree(tr_hdr); + kfree(vars); return rc; } From patchwork Fri Jul 28 19:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F163C001DE for ; Fri, 28 Jul 2023 19:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234290AbjG1Tu2 (ORCPT ); Fri, 28 Jul 2023 15:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjG1TuZ (ORCPT ); Fri, 28 Jul 2023 15:50:25 -0400 Received: from mx.manguebit.com (mx.manguebit.com [167.235.159.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC75D3C07 for ; Fri, 28 Jul 2023 12:50:24 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Be1+OoJlk3lPtyFFMm5Xj1t5nyLX3z79qN7FXZ4QkOg=; b=C5zy2sckiDPPZdYTP6p9UbKfq4bihbWWA6DpfSw5YP3x90CTFK8tVzyICktx8P2rAb41g4 w+6WfDegQWqYsY5ekucOh3blwgTSPDfiXUUEXHQ8dBesoIOglmawbpTz1KMgRexsDVSvM9 JQgzBnDiQSkcqdZXeLyF3nA3lerp/zbE6YufT2rXbJVZtVcrGwNfNahw0PTn4E369ubXOj JHkUvgV8NPUN70b4wVKCM/q0hZxM46kNPjBBXbKFAUcW5xxLGkHlWGqtA4GnmZZM864aqs VBNKuFG+A6drUdZ3ONtyXV/Y1IUkfCsWNvZMkoraFhq2Zcstrc8DJo1no12JoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Be1+OoJlk3lPtyFFMm5Xj1t5nyLX3z79qN7FXZ4QkOg=; b=J2csI5n1jswaihnviiq8HS3jpBsV7yI5EPjd16hO629dVQB6KASHGnEhZXOAjtPeWmcz8B Ym2H2QfH3NJAhZPxOAwgac1ls+h9v5k+C01bWTcoHTAeu5SI78mK8vkztwV7qqmSKoTG4x ROxYJ5O7oUPltzx+4/NgRjHTto8FXWb4yhyCCnxWcsDQySeDGC3YkQhGCnOhPuOvRkDMO3 4pIAqzt4hnmcC8SXYCk1EZruEW6zv0zMlkSF3J1YD6+3WXuMiXUjfXu5GPeLJbNys2C+I0 6FnSxf6FOacC24HlTzCrxfMlRzsU811NbpGgjaFWg+E7FKHE1nKYUoDK82dGRg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573823; a=rsa-sha256; cv=none; b=lKjaw0boKyUNGK50z7UF9TPnnCA1S5N+YQREvur40RGwx3o3QoEhbVoofQq/G+RqD46R+W mw4uXH+pVS03ifbKkHDuNWyCmXciwFFvi/YoqsV68ZH8nkBMV4/hW+NN8lolWRmKNdpzuK 579uDDuHAUcBQhgwQQWCU6S4Nv9Or/AIBSBEuj5MAvuT8v1aoj/K9bkmJKVzL5Ws+Y7LyA 8NlerulQeAhXeeo6IKd1MXuKkyojC3VPehT7C8U0YBUljq3t1lWuKvdiQYQ0NJahmp/dzZ X/24MOXj3y4iNRDwo2jGXim6N+pNSP5EdG+k64m8/6JlUya0iGu3eqoHQny0fg== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 3/8] smb: client: reduce stack usage in cifs_get_inode_info() Date: Fri, 28 Jul 2023 16:50:05 -0300 Message-ID: <20230728195010.19122-3-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/inode.c:963:5: warning: stack frame size (1144) exceeds limit (1024) in 'cifs_get_inode_info' [-Wframe-larger-than] It turns out that cifs_sfu_type() got inlined into cifs_get_inode_info() which contains some stack-allocated variables like @fid(96), @oparms(56), @io_parms(64), @buf(24). Fix this by marking cifs_sfu_type() as noinline_for_stack. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index c3eeae07e139..7f2a7b22427c 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -473,9 +473,10 @@ int cifs_get_inode_info_unix(struct inode **pinode, } #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ -static int -cifs_sfu_type(struct cifs_fattr *fattr, const char *path, - struct cifs_sb_info *cifs_sb, unsigned int xid) +static noinline_for_stack int cifs_sfu_type(struct cifs_fattr *fattr, + const char *path, + struct cifs_sb_info *cifs_sb, + unsigned int xid) { int rc; __u32 oplock; From patchwork Fri Jul 28 19:50:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8BE0C001DF for ; Fri, 28 Jul 2023 19:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234894AbjG1Tub (ORCPT ); Fri, 28 Jul 2023 15:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233555AbjG1Tu1 (ORCPT ); Fri, 28 Jul 2023 15:50:27 -0400 Received: from mx.manguebit.com (mx.manguebit.com [167.235.159.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4A43C1D for ; Fri, 28 Jul 2023 12:50:26 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=quyNTta0OH8gvGxTmj2vFTWhk4xQU5x4/edbZ94u9Fc=; b=h5m47/cxk1yiGOvYLSqsVNy3DgkNUf6TuAMqZ0KLi+AMyJ/uD6kmAk4423OaZ11LnIpxfX 1aaRC5A0ufLLjyrCpjQx7YoicU5QV3dWaOuOx6bFQhX38btn6DbyroOpwnbHZtWrCd079z 11SeOqBKLBvWyJk+QnyRVFtzQ5TX6u2l82ubF94S9ENQk8SqfEmSfpBmEIteeGhGzi+544 NYAF9+eMqcDZVcElY0GeT6pCisLpO86gfrP3pC2nb8fR6XYP4JB3TPCupcTM+lijBDsOQD FKm8rEUxJSNC/Pu941E/dOSJSAiIJbc6Dai9WVE+ZStmauI1yEVau1RHMtXMRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=quyNTta0OH8gvGxTmj2vFTWhk4xQU5x4/edbZ94u9Fc=; b=ikW26s2PChTT31pVuMmAZ94yuuWY3DskGl5U4t3EEHKn6kqIgMIH2IB2BtpVBgM2SbxFyp 66VzM2yABeigCRpm0OUluDEPH2gTlw6XCvsRV0aeoH0aLCCYIh+1T+WfTt44VDoJm3/Kh7 qAeve6Tn+L496nI3jytZ5PuI0VR3/EXFqoYBzfvWVCSgK99g+KPxGk/UqTcsM8hrci9OG2 Zng8WSS+eraH1px5JiXhnBGAtbik5+ZoXtF+xOSoCd5sRenHfS5QoeCO+DSytGCzu7dLv0 djmrn6PDm3n8yyBhumEa+tU/pP1saXnH0iK9Uvz1nTHOK8wFLSYNzm1P41A0iQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573825; a=rsa-sha256; cv=none; b=fRHXcU2lHDNNxvy/2dJ8SSiwe9OfG4tDleLvsxo0ePt70uJu3JCEy8d5kThoQ7Pq5IX7/i DQrpPCWLGl3l5k5iiqYtIuV+Ex70vAJ3p8M9AIDZhZtiUy4jZNdHqeT1uwGCKI9HW6sPBg qcUtLKzyFvaBzE3pRYqXfFqCegWUvA8RIBmKUu7vNSpKp0JP6CrAitaPxJy3L7/fHQWXcL fkKHGvErDp2tYuZO1FbFsEiASyVfCWoPTn9hK0dD5MiCGKOTRM1qhUw+ilKVjqtugN9/AV kIWxaZjXDORMiVLypj6n+i8k0JbRoCp50pvRxVi4+Otl7VulNdpAkoLdaaSfNQ== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 4/8] smb: client: reduce stack usage in smb2_set_ea() Date: Fri, 28 Jul 2023 16:50:06 -0300 Message-ID: <20230728195010.19122-4-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/smb2ops.c:1080:1: warning: stack frame size (1432) exceeds limit (1024) in 'smb2_set_ea' [-Wframe-larger-than] Fix this by allocating a set_ea_vars structure that will hold most of the large structures. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/smb2ops.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 0f62bc373ad0..5c8bcaf41556 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -1075,6 +1075,13 @@ smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon, return rc; } +struct set_ea_vars { + struct smb_rqst rqst[3]; + struct kvec rsp_iov[3]; + struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; + struct kvec si_iov[SMB2_SET_INFO_IOV_SIZE]; + struct kvec close_iov; +}; static int smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, @@ -1082,25 +1089,23 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, const __u16 ea_value_len, const struct nls_table *nls_codepage, struct cifs_sb_info *cifs_sb) { + struct smb2_query_info_rsp *rsp; struct cifs_ses *ses = tcon->ses; + struct set_ea_vars *vars; struct TCP_Server_Info *server = cifs_pick_channel(ses); + struct smb_rqst *rqst; + struct kvec *rsp_iov; __le16 *utf16_path = NULL; int ea_name_len = strlen(ea_name); int flags = CIFS_CP_CREATE_CLOSE_OP; int len; - struct smb_rqst rqst[3]; int resp_buftype[3]; - struct kvec rsp_iov[3]; - struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; struct cifs_open_parms oparms; __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; struct cifs_fid fid; - struct kvec si_iov[SMB2_SET_INFO_IOV_SIZE]; unsigned int size[1]; void *data[1]; struct smb2_file_full_ea_info *ea = NULL; - struct kvec close_iov[1]; - struct smb2_query_info_rsp *rsp; int rc, used_len = 0; if (smb3_encryption_required(tcon)) @@ -1113,9 +1118,15 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, if (!utf16_path) return -ENOMEM; - memset(rqst, 0, sizeof(rqst)); resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - memset(rsp_iov, 0, sizeof(rsp_iov)); + + vars = kzalloc(sizeof(*vars), GFP_KERNEL); + if (!vars) { + rc = -ENOMEM; + goto out_free_path; + } + rqst = vars->rqst; + rsp_iov = vars->rsp_iov; if (ses->server->ops->query_all_EAs) { if (!ea_value) { @@ -1160,8 +1171,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, } /* Open */ - memset(&open_iov, 0, sizeof(open_iov)); - rqst[0].rq_iov = open_iov; + rqst[0].rq_iov = vars->open_iov; rqst[0].rq_nvec = SMB2_CREATE_IOV_SIZE; oparms = (struct cifs_open_parms) { @@ -1181,8 +1191,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, /* Set Info */ - memset(&si_iov, 0, sizeof(si_iov)); - rqst[1].rq_iov = si_iov; + rqst[1].rq_iov = vars->si_iov; rqst[1].rq_nvec = 1; len = sizeof(*ea) + ea_name_len + ea_value_len + 1; @@ -1212,8 +1221,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, /* Close */ - memset(&close_iov, 0, sizeof(close_iov)); - rqst[2].rq_iov = close_iov; + rqst[2].rq_iov = &vars->close_iov; rqst[2].rq_nvec = 1; rc = SMB2_close_init(tcon, server, &rqst[2], COMPOUND_FID, COMPOUND_FID, false); @@ -1228,13 +1236,15 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, sea_exit: kfree(ea); - kfree(utf16_path); SMB2_open_free(&rqst[0]); SMB2_set_info_free(&rqst[1]); SMB2_close_free(&rqst[2]); free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); free_rsp_buf(resp_buftype[2], rsp_iov[2].iov_base); + kfree(vars); +out_free_path: + kfree(utf16_path); return rc; } #endif From patchwork Fri Jul 28 19:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C8F6C001E0 for ; Fri, 28 Jul 2023 19:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233946AbjG1Tuc (ORCPT ); Fri, 28 Jul 2023 15:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234890AbjG1Tu3 (ORCPT ); Fri, 28 Jul 2023 15:50:29 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC2FE422C for ; Fri, 28 Jul 2023 12:50:27 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wvr0CYyrF9RDIB+pxGpzdN0545sG7gzbj9nL0xYlrK8=; b=JoBHwviUmDwK40qqH9IvfEkkNOKiQ+AwXSo4VzJrvlfocWmAuQcSqjrIPi06YX1sMvKlhU HSIz4IEr1lHWJsNRpJwRIqnLL0Ksw7mNz00FbHCiX8G+EhbBJb0KVxIJhqM5Fncv1qtMA3 JPYOdngnSYlYftd0zTgUXVawhgcgeGl0eXGlyPLSkTJIYG6YWcomDL4YhREgFdorEXp3lT Or+/y3eZdW9hkwQ/qPcaTZtoE9PrQz/QqQJ7CcLWrlV+twIPLEMBh5gvFXgq3tUOcVhOuh NL3sHhp+uz4Pgr7TNj/Yllp5KRpCfUo4WcyaZwMFXDIS0Sq0M7Rz65V9Xy2zMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wvr0CYyrF9RDIB+pxGpzdN0545sG7gzbj9nL0xYlrK8=; b=qQ+1gKcU0DO8xmqcT7lTLC+tQLLOpqKM3Bz22w38gk1oFs/X0pgZx8G5GY2P87ivkGvSY/ dNAxmn7J0jpzkAnW6NB5xEVJGCXlesm/GNjb6Rb+KbMQ06Uz774ivba36XO3LL6jb+Zq35 WmDgBRdfvuTYDCgxLxTIlxV5TgVHR+Cs1r7UQYMzMr6Kud/8Gja39/2Ha7kozmguh5I+Vu 0GN4bfctp+jB4qpzUFBtycylCwi2cH/SbErTvjxVJ3fWh3Z+AYVfSTiyP1VsF1FkZZgtv8 qHZZh/QeQqNPxMFcCYhCZOE/2GtQz26a4qHzuoHc0DWrHmEW3r5pUFXhhpYBBQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573826; a=rsa-sha256; cv=none; b=g13UJjlioGtSa+BEKOBHFjUBnxie7oa0ysIhG0Jb3F9vqym4/Pnyujv5EDu5+nv+g4Df+X n/pJ8spO0Wer+QmC1/ubQZljNRfGGO6dtY1uOivvYbUUMqPyZdPhognSK+UNafDFzDwrJt 02I1sc9OlyKjJBVHhMcw8Wj0DMFULmcNhM7DXBnhvHVnYOLYWSqj2Ho6AS/nux9Qixrn44 1evDXIssL5lqsjJszLU/jsy6W0bFMAuUQJGt9S8s+VRFPaH6l9nk37xnVGu7jf8wkvz+t2 sdLBpi688y0Fsfap2Edinyzu1VZxyP436kLYugaWCs1RCONfOrIcADhTq4s1+w== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 5/8] smb: client: reduce stack usage in smb2_query_info_compound() Date: Fri, 28 Jul 2023 16:50:07 -0300 Message-ID: <20230728195010.19122-5-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/smb2ops.c:2530:1: warning: stack frame size (1336) exceeds limit (1024) in 'smb2_query_info_compound' [-Wframe-larger-than] Fix this by allocating a qi_vars structure that will hold most of the large structures. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/smb2ops.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 5c8bcaf41556..d16036c86aa4 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -2522,6 +2522,14 @@ smb2_set_next_command(struct cifs_tcon *tcon, struct smb_rqst *rqst) shdr->NextCommand = cpu_to_le32(len); } +struct qi_vars { + struct smb_rqst rqst[3]; + struct kvec rsp_iov[3]; + struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; + struct kvec qi_iov; + struct kvec close_iov; +}; + /* * Passes the query info response back to the caller on success. * Caller need to free this with free_rsp_buf(). @@ -2536,15 +2544,13 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_ses *ses = tcon->ses; struct TCP_Server_Info *server = cifs_pick_channel(ses); int flags = CIFS_CP_CREATE_CLOSE_OP; - struct smb_rqst rqst[3]; int resp_buftype[3]; - struct kvec rsp_iov[3]; - struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; - struct kvec qi_iov[1]; - struct kvec close_iov[1]; u8 oplock = SMB2_OPLOCK_LEVEL_NONE; struct cifs_open_parms oparms; + struct smb_rqst *rqst; struct cifs_fid fid; + struct qi_vars *vars; + struct kvec *rsp_iov; int rc; __le16 *utf16_path; struct cached_fid *cfid = NULL; @@ -2558,9 +2564,15 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - memset(rqst, 0, sizeof(rqst)); resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - memset(rsp_iov, 0, sizeof(rsp_iov)); + + vars = kzalloc(sizeof(*vars), GFP_KERNEL); + if (!vars) { + rc = -ENOMEM; + goto out_free_path; + } + rqst = vars->rqst; + rsp_iov = vars->rsp_iov; /* * We can only call this for things we know are directories. @@ -2569,8 +2581,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, open_cached_dir(xid, tcon, path, cifs_sb, false, &cfid); /* cfid null if open dir failed */ - memset(&open_iov, 0, sizeof(open_iov)); - rqst[0].rq_iov = open_iov; + rqst[0].rq_iov = vars->open_iov; rqst[0].rq_nvec = SMB2_CREATE_IOV_SIZE; oparms = (struct cifs_open_parms) { @@ -2588,8 +2599,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, goto qic_exit; smb2_set_next_command(tcon, &rqst[0]); - memset(&qi_iov, 0, sizeof(qi_iov)); - rqst[1].rq_iov = qi_iov; + rqst[1].rq_iov = &vars->qi_iov; rqst[1].rq_nvec = 1; if (cfid) { @@ -2616,8 +2626,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, smb2_set_related(&rqst[1]); } - memset(&close_iov, 0, sizeof(close_iov)); - rqst[2].rq_iov = close_iov; + rqst[2].rq_iov = &vars->close_iov; rqst[2].rq_nvec = 1; rc = SMB2_close_init(tcon, server, @@ -2648,7 +2657,7 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, *buftype = resp_buftype[1]; qic_exit: - kfree(utf16_path); + SMB2_open_free(&rqst[0]); SMB2_query_info_free(&rqst[1]); SMB2_close_free(&rqst[2]); @@ -2656,6 +2665,9 @@ smb2_query_info_compound(const unsigned int xid, struct cifs_tcon *tcon, free_rsp_buf(resp_buftype[2], rsp_iov[2].iov_base); if (cfid) close_cached_dir(cfid); + kfree(vars); +out_free_path: + kfree(utf16_path); return rc; } From patchwork Fri Jul 28 19:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE4FEC001DF for ; Fri, 28 Jul 2023 19:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbjG1Tue (ORCPT ); Fri, 28 Jul 2023 15:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234898AbjG1Tub (ORCPT ); Fri, 28 Jul 2023 15:50:31 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC5C2423C for ; Fri, 28 Jul 2023 12:50:29 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ew33RdJsaf/1Ko58ba2y0RGKPZGcDWQ86Nfx7Gd2Vys=; b=j+dildJ8a7kah4ZptU9J44tIzllHc0ST77YAbtzDKplYqtmsmb3hHM/hn2aLVYzP2/qD/1 8opdPJch4Pj9xoRIkFz6JDu4CV+cxInO2SE3RVoWQ4m2n42do0W3BhiDEkWd0Fbo4LIdl/ fCR67LeiEDo0HncpBGkY77g4JaiU/TXg9W0vsLKQ5gNAM8so9QL9SSVn5mxDxpepYPd5zY t+S8+5JpBMAeMg3DHyv3rwssqiC2fILjpKlUeQ1s8gJZzduJgSoNhcxUCE5Ooh1R05wKNO JXCWIiuSWxrrnXce0M/UwJlRWoepIHK2FDuDkQ3TT0XeMV0zGdT5IMtKKIqM6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ew33RdJsaf/1Ko58ba2y0RGKPZGcDWQ86Nfx7Gd2Vys=; b=SWLzAa+QxJjyHDv43zKhSScNiQKImDznEioYZ80rox/kMEXtcIS6kif7+ZeBXRUkkWEpxC HVOKGamVppehoxisEQSO0sCh8EqLGhiXYiQkU/xiFX6CBNUEEmtUizljyxJZtc8urxklEK N3qrSVUcqGPdLjrjAEyE50c7hxatKrmdPtFhmzIWehl0aNDIx8Ic8MpDGf99yWr1+j2o2R JJPyu0N3RIjM4G2+Dgwg8X6HF2gz7l9QfTtN9BP/YVOA1oB/Hh9JjY1wQCXNDs/pOcRvCB /rKXwvkss13K5HU3W4uZRVaZzH2YyHvDwceRM3UbHPe2I4YRbwq2BJnqEDWs8Q== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573828; a=rsa-sha256; cv=none; b=ZpigDEB98nxqWMigR1FE8iSkgprSi/JfQjwEImkm/lDrI6JqZFEN/qvivkedZonFJye5Ex iqOROXpDnqgQpT+XjD8K74+JegqX9tttLNkFaUlXhkx2stX6UUEYBO3lFncX8D0Yqwzzxu D9j3nqiCo/YjZ42Uhnl1lljX2AiYRFVx2oEgcUiwMMGYLvaep9S9zbaTABeR2fygkcXt6w 630Coxza0GpYU3Hy3tI8XapliEnhipGMexKxtMs6bxhFSOOOBGk2iry1Qt9t+qyUPDUOQN MkvP6cCio3l3RYhuCn2Um8XtXo7gapTPR9LsI7fbXlpd1yiMcUBrxRY9LQtW7g== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 6/8] smb: client: reduce stack usage in smb2_query_reparse_tag() Date: Fri, 28 Jul 2023 16:50:08 -0300 Message-ID: <20230728195010.19122-6-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/smb2ops.c:3117:1: warning: stack frame size (1336) exceeds limit (1024) in 'smb2_query_reparse_tag' [-Wframe-larger-than] Fix this by allocating a qr_vars structure that will hold most of the large structures. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/smb2ops.c | 44 ++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index d16036c86aa4..d6a15d5ec4d2 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3113,6 +3113,14 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, return rc; } +struct qr_vars { + struct smb_rqst rqst[3]; + struct kvec rsp_iov[3]; + struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; + struct kvec io_iov[SMB2_IOCTL_IOV_SIZE]; + struct kvec close_iov; +}; + int smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb, const char *full_path, @@ -3124,13 +3132,11 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_open_parms oparms; struct cifs_fid fid; struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); + struct smb_rqst *rqst; + struct qr_vars *vars; + struct kvec *rsp_iov; int flags = CIFS_CP_CREATE_CLOSE_OP; - struct smb_rqst rqst[3]; int resp_buftype[3]; - struct kvec rsp_iov[3]; - struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; - struct kvec io_iov[SMB2_IOCTL_IOV_SIZE]; - struct kvec close_iov[1]; struct smb2_ioctl_rsp *ioctl_rsp; struct reparse_data_buffer *reparse_buf; u32 plen; @@ -3140,20 +3146,25 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - memset(rqst, 0, sizeof(rqst)); - resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - memset(rsp_iov, 0, sizeof(rsp_iov)); - utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb); if (!utf16_path) return -ENOMEM; + resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; + + vars = kzalloc(sizeof(*vars), GFP_KERNEL); + if (!vars) { + rc = -ENOMEM; + goto out_free_path; + } + rqst = vars->rqst; + rsp_iov = vars->rsp_iov; + /* * setup smb2open - TODO add optimization to call cifs_get_readable_path * to see if there is a handle already open that we can use */ - memset(&open_iov, 0, sizeof(open_iov)); - rqst[0].rq_iov = open_iov; + rqst[0].rq_iov = vars->open_iov; rqst[0].rq_nvec = SMB2_CREATE_IOV_SIZE; oparms = (struct cifs_open_parms) { @@ -3173,8 +3184,7 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, /* IOCTL */ - memset(&io_iov, 0, sizeof(io_iov)); - rqst[1].rq_iov = io_iov; + rqst[1].rq_iov = vars->io_iov; rqst[1].rq_nvec = SMB2_IOCTL_IOV_SIZE; rc = SMB2_ioctl_init(tcon, server, @@ -3191,8 +3201,7 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, /* Close */ - memset(&close_iov, 0, sizeof(close_iov)); - rqst[2].rq_iov = close_iov; + rqst[2].rq_iov = &vars->close_iov; rqst[2].rq_nvec = 1; rc = SMB2_close_init(tcon, server, @@ -3230,13 +3239,16 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, } query_rp_exit: - kfree(utf16_path); + SMB2_open_free(&rqst[0]); SMB2_ioctl_free(&rqst[1]); SMB2_close_free(&rqst[2]); free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); free_rsp_buf(resp_buftype[2], rsp_iov[2].iov_base); + kfree(vars); +out_free_path: + kfree(utf16_path); return rc; } From patchwork Fri Jul 28 19:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2082C00528 for ; Fri, 28 Jul 2023 19:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjG1Tue (ORCPT ); Fri, 28 Jul 2023 15:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234917AbjG1Tud (ORCPT ); Fri, 28 Jul 2023 15:50:33 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664DC422C for ; Fri, 28 Jul 2023 12:50:31 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FoWtuTQmWodLTCmNngcddTZu4+cn7yVKE2521QaGd7A=; b=D7htvM6OZNi87RPZQKhG0ABKFRxZlQ+X4z3XFTyAnURggu2zd0BgQ8Ys8M16ZltYC3UOO6 U4W0Fc3cH3VMlQBmVIh4vLq2vkiD4oW//dJYGrImZEaI2BbBQy+t5++ed7fTu9RZd2LdSP o/nZItwA+jCD+189tVgXVwRmCDgIdC9ReQg31ZBpc26QQNcuBCp4CR7NszO2CLmSeSPQET 7rxLz6X8w/uMJlHxzis0YeIhGvYyZ9a9FV9PfHe1IGlYPbfFbcWdM1ygDobYId7nXrlQgV 5hcUHQHkoOY6hrKZYsbWMJJ/40tgdjAaNi4ZE1sFgLkuCemunVZHDhBPeskgCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FoWtuTQmWodLTCmNngcddTZu4+cn7yVKE2521QaGd7A=; b=OV8OqWcfQyr6MM4J0RYNG+JYvxhLp1srStuC3GohmXtGY/7GcGk9Uz87xB7C5MnhWAKvvk SVkqhssmAcINn9BSH9VVVjCN3CpvOWBnBFzQy8+VqIvlTaMBAZREZpQLkiHgwe//AJ1uc4 A7qtw/Hht8fnnaW5zXW3nrmGd71/MoPizEA+iYPfe9N32uDAXV2yFrrJ2I3q8CeTGK62QN aH6ifzDyLlnxM0NoFt8eyF+6BR4DxRA2qGqT3mZL6YEuUQe25mB5+nmqN/Pn5kehocIc9f 9R1JYkZakW8Ze0Ki/va5EH5NFD1pUK19VW4Cyg6XhwOvrm/xZUgn7NkYLXPWRw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573830; a=rsa-sha256; cv=none; b=mZtLI88kIytR5dp41DIpzA/xHGtgUpLVpsHiiR8Po4Q5cNZdOymkLRzcB475jDKPbndSYd nO13DyuIeVliM+lXV9GvaTFoqvmNacjyszBs01MKQp7+S1GHGnI82GHjwoGqo9g4leGUz9 bEcEBbq3kemcVhgm3KOZeB+0rWrh1CTNDXPyYtoPXx6ykU79gEXQj6/qBrX5hdqL3483O4 A/1qEokj8I0bld78b8hd26jZwzoS9RlZWaRI9Ag69GHQ9UlNU/BWsaZ+BVtXh3h9CS3VpK AXRuax2gBFTX6iIi1TSIQibwam13DNE8FLXrQKWia4tT5SNCmFrZ3Vns9FPdlw== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 7/8] smb: client: reduce stack usage in smb2_query_symlink() Date: Fri, 28 Jul 2023 16:50:09 -0300 Message-ID: <20230728195010.19122-7-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/smb2ops.c:2974:1: warning: stack frame size (1368) exceeds limit (1024) in 'smb2_query_symlink' [-Wframe-larger-than] Fix this by allocating a qs_vars structure that will hold most of the large structures. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya --- fs/smb/client/smb2ops.c | 43 ++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index d6a15d5ec4d2..9136c77cd407 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -2970,6 +2970,14 @@ parse_reparse_point(struct reparse_data_buffer *buf, } } +struct qs_vars { + struct smb_rqst rqst[3]; + struct kvec rsp_iov[3]; + struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; + struct kvec io_iov[SMB2_IOCTL_IOV_SIZE]; + struct kvec close_iov; +}; + static int smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb, const char *full_path, @@ -2979,16 +2987,14 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, __le16 *utf16_path = NULL; __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; struct cifs_open_parms oparms; + struct smb_rqst *rqst; struct cifs_fid fid; + struct qs_vars *vars; struct kvec err_iov = {NULL, 0}; + struct kvec *rsp_iov; struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); int flags = CIFS_CP_CREATE_CLOSE_OP; - struct smb_rqst rqst[3]; int resp_buftype[3]; - struct kvec rsp_iov[3]; - struct kvec open_iov[SMB2_CREATE_IOV_SIZE]; - struct kvec io_iov[SMB2_IOCTL_IOV_SIZE]; - struct kvec close_iov[1]; struct smb2_create_rsp *create_rsp; struct smb2_ioctl_rsp *ioctl_rsp; struct reparse_data_buffer *reparse_buf; @@ -3002,17 +3008,22 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, if (smb3_encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - memset(rqst, 0, sizeof(rqst)); - resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; - memset(rsp_iov, 0, sizeof(rsp_iov)); - utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb); if (!utf16_path) return -ENOMEM; + resp_buftype[0] = resp_buftype[1] = resp_buftype[2] = CIFS_NO_BUFFER; + + vars = kzalloc(sizeof(*vars), GFP_KERNEL); + if (!vars) { + rc = -ENOMEM; + goto out_free_path; + } + rqst = vars->rqst; + rsp_iov = vars->rsp_iov; + /* Open */ - memset(&open_iov, 0, sizeof(open_iov)); - rqst[0].rq_iov = open_iov; + rqst[0].rq_iov = vars->open_iov; rqst[0].rq_nvec = SMB2_CREATE_IOV_SIZE; oparms = (struct cifs_open_parms) { @@ -3032,8 +3043,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, /* IOCTL */ - memset(&io_iov, 0, sizeof(io_iov)); - rqst[1].rq_iov = io_iov; + rqst[1].rq_iov = vars->io_iov; rqst[1].rq_nvec = SMB2_IOCTL_IOV_SIZE; rc = SMB2_ioctl_init(tcon, server, @@ -3050,8 +3060,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, /* Close */ - memset(&close_iov, 0, sizeof(close_iov)); - rqst[2].rq_iov = close_iov; + rqst[2].rq_iov = &vars->close_iov; rqst[2].rq_nvec = 1; rc = SMB2_close_init(tcon, server, @@ -3103,13 +3112,15 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, querty_exit: cifs_dbg(FYI, "query symlink rc %d\n", rc); - kfree(utf16_path); SMB2_open_free(&rqst[0]); SMB2_ioctl_free(&rqst[1]); SMB2_close_free(&rqst[2]); free_rsp_buf(resp_buftype[0], rsp_iov[0].iov_base); free_rsp_buf(resp_buftype[1], rsp_iov[1].iov_base); free_rsp_buf(resp_buftype[2], rsp_iov[2].iov_base); + kfree(vars); +out_free_path: + kfree(utf16_path); return rc; } From patchwork Fri Jul 28 19:50:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Alcantara X-Patchwork-Id: 13332623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E98E8C001DE for ; Fri, 28 Jul 2023 19:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbjG1Tum (ORCPT ); Fri, 28 Jul 2023 15:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234973AbjG1Tul (ORCPT ); Fri, 28 Jul 2023 15:50:41 -0400 Received: from mx.manguebit.com (mx.manguebit.com [IPv6:2a01:4f8:1c1e:a2ae::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 747B0448C for ; Fri, 28 Jul 2023 12:50:33 -0700 (PDT) From: Paulo Alcantara DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=95LJjiWvoxvT8lSZR4mlhxO1lfF8Gg4A/5jpnQs/5G0=; b=rvF6BUniGZ3tIR1thREVLXBTAnMVJCx4Q2FNTkzmH9NW/xLmCfUJ7QlzVNVgMoWHyy8ZD0 1HCy6m/tBo9XF3cqNNE6qfjfBStjQHWw5VagaIZTGc3dtkA0NX5BUjzJqVue4uMWExZ9/z lxYVzgL3TgXVolwMs7Ix+j3kmMp59E3lA4dBPIjHL5tHKMBPNt0d/UtHMt0lC9VgsPDwqv LriegShOHKm/OECA+uzKUadSc/tb/0YPpEk4OW6Q8fEA0xXRzoiHh+RdtOEasXd/Ebx0OI 2UPO9brEn86PJwyK86zcJjMgoJ3HGarnAVjtMLRbPE+Kv3g+9SUBvQe5gIWMqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=manguebit.com; s=dkim; t=1690573831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=95LJjiWvoxvT8lSZR4mlhxO1lfF8Gg4A/5jpnQs/5G0=; b=B+/6SAPueLgdu4acHkjNPQiQxOv27okMiF46fSQuZmSxNxe/VuIqF8fZHVrD4IeQw/yrMt JKS6uZVxAsTd2debIsvwcbNXzP7djPdGXcq9BiGPg8ojeI5v3gmQU6md+tLFHETA5L4m/i JfpXSyiKuI335ytJXWVzLt41cSH2tPoGZR7pJx0WA+Er0F+9ZPFx4gRHGnobl1XogDy8sa 3AoM0AjyLhuMSix+SFMn57Py/ZogHopxSKps7yJIW/JeceHKuHBIoJqJzuclEnDgRz09a2 RlKyHeBtxNl7kffgaAqryltI0TvUle+FLdqbAKCSa5iGJcovOm4P3moOO+suCA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pc@manguebit.com smtp.mailfrom=pc@manguebit.com ARC-Seal: i=1; s=dkim; d=manguebit.com; t=1690573831; a=rsa-sha256; cv=none; b=gDCOVj082BWSA57VMyND9uIkU9jYjnaAXxtIlc7i5AzkFzHRE4vrApcaE52BhFogKU8xG6 QVGp79criCLOSm2Lmh8VBTBD4ddQu/xi+yzHrwCaD/VUPyYpA6oDgE1a0aaKbhGpACo8PD OjYSXjadGo2jGZc4Lzw4bTMUS1VKUxlFzNiIwajoRIYdEqHU4SDU5qll1mgmrQPCbWCqIW bfYFrkm7izIUtZ5cHZP8dsgPUm9B7yQbpAqjuHJKAxA4qJL3utG1W86HO8rXzXd1AQfIOD W70SFQgKwKhdtU7dLDXofgHbuIgBrh/rM03ZeVXf7MJsydQ33wtOrDwArWwT3Q== To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Paulo Alcantara Subject: [PATCH 8/8] smb: client: reduce stack usage in cifs_demultiplex_thread() Date: Fri, 28 Jul 2023 16:50:10 -0300 Message-ID: <20230728195010.19122-8-pc@manguebit.com> In-Reply-To: <20230728195010.19122-1-pc@manguebit.com> References: <20230728195010.19122-1-pc@manguebit.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Clang warns about exceeded stack frame size fs/smb/client/connect.c:1109:1: warning: stack frame size (1048) exceeds limit (1024) in 'cifs_demultiplex_thread' [-Wframe-larger-than] It turns out that clean_demultiplex_info() got inlined into cifs_demultiplex_thread(), so mark it as noinline_for_stack to save some stack space. Signed-off-by: Paulo Alcantara (SUSE) --- fs/smb/client/connect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 238538dde4e3..ace1ec273364 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -911,8 +911,8 @@ cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required) return 0; } - -static void clean_demultiplex_info(struct TCP_Server_Info *server) +static noinline_for_stack void +clean_demultiplex_info(struct TCP_Server_Info *server) { int length;