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.

Bug 1579050

Summary: make soft cifs mounts return failure after logon failure during reconnect rather than retry forever
Product: Red Hat Enterprise Linux 7 Reporter: Frank Sorenson <fsorenso>
Component: kernelAssignee: cifs-maint
kernel sub component: CIFS QA Contact: xiaoli feng <xifeng>
Status: CLOSED WONTFIX Docs Contact:
Severity: unspecified    
Priority: unspecified CC: dwysocha, jshivers, lsahlber, xzhou
Version: 7.5Keywords: FutureFeature, Reproducer
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1798031 (view as bug list) Environment:
Last Closed: 2020-02-04 12:22:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Sorenson 2018-05-16 21:36:46 UTC
Description of problem:

If a cifs mount becomes unavailable, requiring a reconnect, and an application has generated a request which is blocked, and the credentials are no longer valid (for example, password has changed), the cifs client will reattempt the session setup forever, using the now-invalid credentials.

Because there is no way to update the stored password, the mount will never be usable again, but the reconnect will be reattempted hundreds of times/second.

For a 'soft' mount, at least, the kernel should give up the reconnect attempt, and return an error to the application, 


Version-Release number of selected component (if applicable):

kernel-*



How reproducible:

easy

Steps to Reproduce:


set an 'idle' disconnect of 1 minute in /etc/smb.conf on samba server
	deadtime = 1

# useradd testuser
# echo -e 'test1\ntest1' | smbpasswd -L -s testuser


on the client:

# mount.cifs //server/testuser /mnt/test -o username=testuser,password=test1,soft

doio.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

int main(int argc, char *argv[]) {
        char buf[] = "TESTING";
        int ret, fd;

        fd = open("testfile", O_RDWR|O_CREAT|O_TRUNC, 0660);
        while (42) {
                if ((ret = write(fd, buf, strlen(buf))) != strlen(buf))
                        break;
                sleep(1);
        }
        printf("write returned %d. error: %m\n", ret);
        return EXIT_FAILURE;
}

# cd /mnt/test
# gcc doio.c -o doio
# ./doio



back on the server, change the password:
# echo -e 'test2\ntest2' | smbpasswd -L -s testuser

firewall off the client for a minute or two:
# iptables -A INPUT -s client -j DROP ; sleep 120 ; iptables -F



Actual results:

the server will time out and disconnect the 'idle' client, and/or the client will restart the session setup

reconnection is impossible due to the changed password

processes hang, potentially unkillable
kernel attempts reconnect at high rate causing high network & cpu usage, syslog fills with NT_STATUS_LOGON_FAILURE messages


Expected results:

Customer expects 'soft' mount to return IO error to application, and not block indefinitely


Additional info:

Comment 2 Dave Wysochanski 2020-01-25 12:58:22 UTC
This looks like an RFE and another variant (credentials change) to the RHEL8 bug (server shutdown) https://bugzilla.redhat.com/show_bug.cgi?id=1692651#c1 but still the underlying problem is never-ending retries / hang with cifs client.
My guess is this will not be possible in RHEL7 but I have not looked at the code paths closely.  Ronnie what do you think - should we move this to RHEL8 and track along with the other RHEL8 bug or dup to that bug with a statement about the specific case reported here (credential change)?

Comment 5 Dave Wysochanski 2020-02-04 12:22:38 UTC
I'm going to clone this to RHEL8, and close this bug (RHEL7) version for now.  If we get an urgent need then we can re-open but right now this looks like very low priority given where RHEL7 is.