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 1712197 - crash in is_size_safe_to_change as the result of race condition in management of cifsInodeInfo->openFileList
Summary: crash in is_size_safe_to_change as the result of race condition in management...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: kernel
Version: 8.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: 8.1
Assignee: cifs-maint
QA Contact: JianHong Yin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-21 02:20 UTC by Frank Sorenson
Modified: 2023-09-07 20:03 UTC (History)
9 users (show)

Fixed In Version: kernel-4.18.0-111.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 21:55:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3446331 0 None None None 2019-09-06 03:26:02 UTC
Red Hat Product Errata RHSA-2019:3517 0 None None None 2019-11-05 21:55:25 UTC

Description Frank Sorenson 2019-05-21 02:20:51 UTC
Description of problem:

A list corruption of cifsInodeInfo->openFileList can occur due to a race condition between multiple processes opening/closing the same file.  The list corruption then results in a crash while walking the list in is_inode_writeable()


[ 1623.170714] general protection fault: 0000 [#1] SMP PTI
[ 1623.170749] CPU: 2 PID: 13949 Comm: R Kdump: loaded Not tainted 4.18.0-80.1.2.el8_0.x86_64 #1
[ 1623.170778] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[ 1623.170841] RIP: 0010:is_size_safe_to_change+0x57/0xb0 [cifs]
...
[ 1623.171273]  cifs_fattr_to_inode+0x146/0x580 [cifs]
[ 1623.171302]  cifs_get_file_info+0xed/0x360 [cifs]
[ 1623.171329]  cifs_llseek+0x4a/0xc0 [cifs]
[ 1623.171349]  ksys_lseek+0x62/0xb0
[ 1623.171366]  do_syscall_64+0x5b/0x1b0
[ 1623.171382]  entry_SYSCALL_64_after_hwframe+0x65/0xca



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

4.18.0-80.1.2.el8_0.x86_64
(also seen previously in RHEL 7)


How reproducible:

simple; see reproducer below


Steps to Reproduce:


test program /tmp/openloop.py
#!/usr/bin/env python
from __future__ import print_function
i=0
while True:
    with open('testfile', 'r') as myfile:
        content = myfile.read()
        print("test {}\r".format(i), end="")
        i = i + 1



# mount.cifs //vm1/share /mnt/vm1 --verbose -o vers=2.1,sec=krb5,multiuser
# cd /mnt/vm1
# echo testing > testfile

start 3 copies of the test program, each with different krb5 creds:

# su - user1
$ kinit -kt krb5-smbuser1.keytab -c /tmp/krb5cc_$UID smbuser1
$ cd /mnt/vm1
$ /tmp/openloop.py

# su - user2
$ kinit -kt krb5-smbuser2.keytab -c /tmp/krb5cc_$UID smbuser2
$ cd /mnt/vm1
$ /tmp/openloop.py

# su - user3
$ kinit -kt krb5-smbuser3.keytab -c /tmp/krb5cc_$UID smbuser3
$ cd /mnt/vm1
$ /tmp/openloop.py


The crash will usually occur within several minutes


Actual results:

kernel crash


Expected results:

no crash


Additional info:

also see RHEL 7 BZ 1580165 for this issue

Comment 4 Frank Sorenson 2019-05-29 18:29:48 UTC
Note: I have reproduced this crash without kerberos.  Simply mount with 'multiuser', then have 2-3 users run the test script using their own creds:

# su - user1
$ cifscreds add vm1
Password: 
$ cd /mnt/vm1
$ ./openloop

(and similar with user2 and user3)

Comment 5 Frank Sorenson 2019-06-03 00:02:18 UTC
This is not reproducing for me with a 5.1 kernel

Comment 8 Herton R. Krzesinski 2019-07-04 14:18:50 UTC
Patch(es) available on kernel-4.18.0-111.el8

Comment 17 errata-xmlrpc 2019-11-05 21:55:09 UTC
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-2019:3517


Note You need to log in before you can comment on or make changes to this bug.