Message ID | 20240126193143.245122-1-kovalev@altlinux.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-40572-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp103932dyb; Fri, 26 Jan 2024 11:33:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGztCdxeNB8JowmK5gMVvC5UN6jNlAWWtcv0bnoI2noxgLkhCspI5XXRuWXF5RclKeODd7q X-Received: by 2002:a17:906:111b:b0:a34:c491:292d with SMTP id h27-20020a170906111b00b00a34c491292dmr519537eja.18.1706297603212; Fri, 26 Jan 2024 11:33:23 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gy16-20020a170906f25000b00a3171158db7si925076ejb.614.2024.01.26.11.33.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 11:33:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40572-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-40572-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40572-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CF3551F22FC3 for <ouuuleilei@gmail.com>; Fri, 26 Jan 2024 19:33:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E523249FA; Fri, 26 Jan 2024 19:32:17 +0000 (UTC) Received: from air.basealt.ru (air.basealt.ru [194.107.17.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 638D22375D; Fri, 26 Jan 2024 19:32:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.39 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706297535; cv=none; b=CPb76cG332f6I+CgC4tb9rIX2CA5EdJtZs37b7y8pUFTYbSIsbEF1t7XtTX/+8hGVGJxswOx6Syg4217xZjU3HCVi1cHKaKyyu5BSI5FYTOw6f1PzabRdYIh5kSQQpMbdP9JhoP6tkuVaYU+9OGUirnPGX8fTv0mJllYi/YXX1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706297535; c=relaxed/simple; bh=/hxB9mWKi9mgLDpS2dW9KVNxf5L9+nCnH/rGPcZKBWE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PhN2NowXya16d6cPaW3+xQxQI2hkjmtZY5rLaGieBOdQRXHWdg5TXHxzNx8zhKTD43mmWVcuPdR90JxA49L2gfyH95TPNk/EBLvhrYWWhNVs4BSyw2wKtCmiiimnGvy7jSw1q2gBoMxsNMoV3QIjoUy9cEvFC+pUErI8Gm35AJM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: by air.basealt.ru (Postfix, from userid 490) id 17B3C2F2023C; Fri, 26 Jan 2024 19:32:09 +0000 (UTC) X-Spam-Level: Received: from altlinux.ipa.basealt.ru (unknown [178.76.204.78]) by air.basealt.ru (Postfix) with ESMTPSA id 59C002F20236; Fri, 26 Jan 2024 19:32:04 +0000 (UTC) From: kovalev@altlinux.org To: stable@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Cc: keescook@chromium.org, sfrench@samba.org, corbet@lwn.net, natechancellor@gmail.com, ndesaulniers@google.com, kovalev@altlinux.org Subject: [PATCH 0/2] smb: client: fix "df: Resource temporarily unavailable" on 5.10 stable kernel Date: Fri, 26 Jan 2024 22:31:41 +0300 Message-Id: <20240126193143.245122-1-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789182715703393027 X-GMAIL-MSGID: 1789182715703393027 |
Series |
smb: client: fix "df: Resource temporarily unavailable" on 5.10 stable kernel
|
|
Message
Vasiliy Kovalev
Jan. 26, 2024, 7:31 p.m. UTC
After mounting a remote cifs resource, it becomes unavailable: df: /mnt/sambashare: Resource temporarily unavailable It was tested on the following Linux kernels: Linux altlinux 5.10.208-std-def-alt1 Linux fedora 5.10.208-200.el8.x86_64 The error appeared starting from kernel 5.10.206 after adding the commit [1] "smb: client: fix OOB in SMB2_query_info_init()", in which the buffer length increases by 1 as a result of changes: .. - iov[0].iov_len = total_len - 1 + input_len; + iov[0].iov_len = len; .. [1] https://patchwork.kernel.org/project/cifs-client/patch/20231213152557.6634-2-pc@manguebit.com/ Error fixed by backported commits in next two patches adapted for the 5.10 kernel: [PATCH 1/2] stddef: Introduce DECLARE_FLEX_ARRAY() helper [PATCH 2/2] smb3: Replace smb2pdu 1-element arrays with flex-arrays
Comments
On Fri, Jan 26, 2024 at 10:31:41PM +0300, kovalev@altlinux.org wrote: > After mounting a remote cifs resource, it becomes unavailable: > df: /mnt/sambashare: Resource temporarily unavailable > > It was tested on the following Linux kernels: > Linux altlinux 5.10.208-std-def-alt1 > Linux fedora 5.10.208-200.el8.x86_64 > > The error appeared starting from kernel 5.10.206 after adding > the commit [1] "smb: client: fix OOB in SMB2_query_info_init()", > in which the buffer length increases by 1 as a result of changes: > ... > - iov[0].iov_len = total_len - 1 + input_len; > + iov[0].iov_len = len; > ... > > [1] https://patchwork.kernel.org/project/cifs-client/patch/20231213152557.6634-2-pc@manguebit.com/ > > Error fixed by backported commits in next two patches adapted for the 5.10 kernel: > > [PATCH 1/2] stddef: Introduce DECLARE_FLEX_ARRAY() helper > [PATCH 2/2] smb3: Replace smb2pdu 1-element arrays with flex-arrays > > Now queued up, thanks. greg k-h
Hi, Adding more people to CC.(who have looked at this issue) On 27/01/24 6:19 am, Greg KH wrote: > On Fri, Jan 26, 2024 at 10:31:41PM +0300, kovalev@altlinux.org wrote: >> After mounting a remote cifs resource, it becomes unavailable: >> df: /mnt/sambashare: Resource temporarily unavailable >> >> It was tested on the following Linux kernels: >> Linux altlinux 5.10.208-std-def-alt1 >> Linux fedora 5.10.208-200.el8.x86_64 >> >> The error appeared starting from kernel 5.10.206 after adding >> the commit [1] "smb: client: fix OOB in SMB2_query_info_init()", >> in which the buffer length increases by 1 as a result of changes: >> ... >> - iov[0].iov_len = total_len - 1 + input_len; >> + iov[0].iov_len = len; >> ... >> We can reproduce this on 5.15.148(latest 5.15.y) and Mohamed reported this on 6.1.y, so we need backports there as well. https://lore.kernel.org/all/09738f0f-53a2-43f1-a09d-a2bef48e1344@oracle.com/ [root@vm1 xfstests-dev]# ./check -g quick -s smb3 TEST_DEV=//<SERVER_IP>/TEST is mounted but not a type cifs filesystem [root@vm1 xfstests-dev]# df df: /mnt/test: Resource temporarily unavailable This two patch series doesn't cleanly apply to 5.15.y. Also I am unsure, which is the better approach to go with Approach 1 - suggested by Paulo: https://lore.kernel.org/all/446860c571d0699ed664175262a9e84b@manguebit.com/ Approach 2 - this series Pulling in [PATCH 2/2] smb3: Replace smb2pdu 1-element arrays with flex-arrays like this series did. I think approach 1 is better as the changes are minimal, but please correct me if that seems wrong. Thanks, Harshit >> [1] https://patchwork.kernel.org/project/cifs-client/patch/20231213152557.6634-2-pc@manguebit.com/ >> >> Error fixed by backported commits in next two patches adapted for the 5.10 kernel: >> >> [PATCH 1/2] stddef: Introduce DECLARE_FLEX_ARRAY() helper >> [PATCH 2/2] smb3: Replace smb2pdu 1-element arrays with flex-arrays >> >> > > Now queued up, thanks. > > greg k-h >
Hi, 27.01.2024 09:42, Harshit Mogalapalli wrote: > We can reproduce this on 5.15.148(latest 5.15.y) and Mohamed reported > this on 6.1.y, so we need backports there as well. in the 6.1.72 kernel, this problem was fixed by the commit [1] "smb3: Replace smb2pdu 1-element arrays with flex-arrays", which was proposed in this series of patches. [1] https://lore.kernel.org/all/2024010937-eggplant-bauble-d556@gregkh/T/
Hi Kovalev, On 27/01/24 1:32 pm, kovalev@altlinux.org wrote: > Hi, > > 27.01.2024 09:42, Harshit Mogalapalli wrote: >> We can reproduce this on 5.15.148(latest 5.15.y) and Mohamed reported >> this on 6.1.y, so we need backports there as well. > > in the 6.1.72 kernel, this problem was fixed by the commit [1] "smb3: > Replace smb2pdu 1-element arrays with flex-arrays", which was proposed > in this series of patches. > Thanks for sharing this, I didnot notice that the above commit was backported to 6.1.72. I think we still need fixing in 5.15.y as the commit eb3e28c1e89b ("smb3: Replace smb2pdu 1-element arrays with flex-arrays") is not in 5.15.148 Thanks, Harshit > > [1] https://lore.kernel.org/all/2024010937-eggplant-bauble-d556@gregkh/T/ >
On Sat, Jan 27, 2024 at 06:59:15PM +0530, Harshit Mogalapalli wrote: > Hi Kovalev, > > On 27/01/24 1:32 pm, kovalev@altlinux.org wrote: > > Hi, > > > > 27.01.2024 09:42, Harshit Mogalapalli wrote: > > > We can reproduce this on 5.15.148(latest 5.15.y) and Mohamed > > > reported this on 6.1.y, so we need backports there as well. > > > > in the 6.1.72 kernel, this problem was fixed by the commit [1] "smb3: > > Replace smb2pdu 1-element arrays with flex-arrays", which was proposed > > in this series of patches. > > > Thanks for sharing this, I didnot notice that the above commit was > backported to 6.1.72. > > I think we still need fixing in 5.15.y as the commit eb3e28c1e89b ("smb3: > Replace smb2pdu 1-element arrays with flex-arrays") is not in 5.15.148 Patches gladly accepted :)
On Sat, Jan 27, 2024 at 12:43 AM Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> wrote: > > Hi, > > Adding more people to CC.(who have looked at this issue) > > On 27/01/24 6:19 am, Greg KH wrote: > > On Fri, Jan 26, 2024 at 10:31:41PM +0300, kovalev@altlinux.org wrote: > >> After mounting a remote cifs resource, it becomes unavailable: > >> df: /mnt/sambashare: Resource temporarily unavailable > >> > >> It was tested on the following Linux kernels: > >> Linux altlinux 5.10.208-std-def-alt1 > >> Linux fedora 5.10.208-200.el8.x86_64 > >> > >> The error appeared starting from kernel 5.10.206 after adding > >> the commit [1] "smb: client: fix OOB in SMB2_query_info_init()", > >> in which the buffer length increases by 1 as a result of changes: > >> ... > >> - iov[0].iov_len = total_len - 1 + input_len; > >> + iov[0].iov_len = len; > >> ... > >> > > We can reproduce this on 5.15.148(latest 5.15.y) and Mohamed reported > this on 6.1.y, so we need backports there as well. > > https://lore.kernel.org/all/09738f0f-53a2-43f1-a09d-a2bef48e1344@oracle.com/ > > > [root@vm1 xfstests-dev]# ./check -g quick -s smb3 > TEST_DEV=//<SERVER_IP>/TEST is mounted but not a type cifs filesystem > [root@vm1 xfstests-dev]# df > df: /mnt/test: Resource temporarily unavailable > > > This two patch series doesn't cleanly apply to 5.15.y. > > Also I am unsure, which is the better approach to go with > > Approach 1 - suggested by Paulo: > https://lore.kernel.org/all/446860c571d0699ed664175262a9e84b@manguebit.com/ > > Approach 2 - this series > Pulling in [PATCH 2/2] smb3: Replace smb2pdu 1-element arrays with > flex-arrays like this series did. > > I think approach 1 is better as the changes are minimal, but please > correct me if that seems wrong. Yes - Paulo's fix looks simple