Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #1771687 +++
Description of problem:
If a process opening a file is killed while waiting for a SMB2_CREATE response from the server, the response may not be handled by the client, leaking an open file handle on the server.
Version-Release number of selected component (if applicable):
all kernels (RHEL 7, RHEL 8, upstream)
How reproducible:
easy
Steps to Reproduce:
# mount //vm3/user1 /mnt/vm3 -overs=3,sec=ntlmssp,credentials=/root/.user1_smb_creds
# cd /mnt/vm3
# echo foo > foo
# for i in {1..100} ; do cat foo >/dev/null 2>&1 & sleep 0.0001 ; kill -9 $! ; done
(increase count if necessary--100 appears sufficient to cause multiple leaked file handles)
Actual results:
the client stops waiting for the response, and outputs the following message when the response arrives:
CIFS VFS: Close unmatched open
the server leaks an open file handle--can be seen using samba, with the following:
# smbstatus | grep -i Locked -A1000
Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
25936 501 DENY_NONE 0x80 RDONLY NONE /home/user1 . Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x80 RDONLY NONE /home/user1 . Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x120089 RDONLY LEASE(RWH) /home/user1 foo Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x120089 RDONLY LEASE(RWH) /home/user1 foo Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x120089 RDONLY LEASE(RWH) /home/user1 foo Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x120089 RDONLY LEASE(RWH) /home/user1 foo Tue Nov 12 12:29:24 2019
25936 501 DENY_NONE 0x120089 RDONLY LEASE(RWH) /home/user1 foo Tue Nov 12 12:29:24 2019
Expected results:
the client handles the open response, and then closes the file (can the create/open be canceled?)
Additional info:
--- Additional comment from RHEL Product and Program Management on 2019-11-12 13:14:37 CST ---
Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Patches addressing this behavior were submitted upstream after merging from cifs-next:
9150c3adbf24d77cfba37f03639d4a908ca4ac25 CIFS: Close open handle after interrupted close
7b71843fa7028475b052107664cbe120156a2cfc CIFS: Do not miss cancelled OPEN responses
86a7964be7afaf3df6b64faaa10a7032d2444e51 CIFS: Fix NULL pointer dereference in mid callback
Confirmed that the behavior can not be reproduced on rawhide build 5.4.0-2.fc32.x86_64.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2020:1769