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 1571292 - VDO misuses GFP flags to __vmalloc
Summary: VDO misuses GFP flags to __vmalloc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kmod-kvdo
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Thomas Jaskiewicz
QA Contact: Jakub Krysl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-24 13:08 UTC by Sweet Tea Dorminy
Modified: 2021-09-03 12:06 UTC (History)
4 users (show)

Fixed In Version: 6.1.1.113
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:39:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3094 0 None None None 2018-10-30 09:40:09 UTC

Description Sweet Tea Dorminy 2018-04-24 13:08:50 UTC
Description of problem:
VDO has a central allocation function, allocateMemory(). It attempts to use kmalloc or __vmalloc to satisfy allocations. This should probably be kvmalloc, as is the standard kernel practice. Moreover, it passes the same flags to __vmalloc as to kmalloc, including GFP_NOIO when IO is unsafe to do to satisfy the allocation, and __GFP_REPEAT/__GFP_RETRY_MAYFAIL. 

As per [1], using __vmalloc in a situation where IO is unsafe at all is unsafe, even if GFP_NOIO is pased to __vmalloc, because it may do a kmalloc without GFP_NOIO. This could lead to a deadlock in certain lowmem situations. Furthermore, as per [2], the use of retry modifiers (i.e. __GFP_RETRY_MAYFAIL) as parameters to __vmalloc is not supported.


[1] http://lkml.iu.edu/hypermail/linux/kernel/1706.3/04681.html
[2] https://elixir.bootlin.com/linux/latest/source/mm/vmalloc.c#L1780

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

Actual results:
Extremely rare (theoretical) deadlock under low memory conditions.

Expected results:
No deadlock even under low memory conditions.

Additional info:
Probably SanityOnly.

Comment 2 Thomas Jaskiewicz 2018-07-17 19:00:54 UTC
We will stop using the __GFP_NORETRY flag.

We will stop using GFP_NOIO, and instead use the memalloc_noio_save and memalloc_noio_restore methods, which have been backported to RHEL7.5

Comment 3 Thomas Jaskiewicz 2018-07-18 00:59:30 UTC
Fixed in version 6.1.1.113

Comment 5 Jakub Krysl 2018-08-30 14:59:20 UTC
As reproducing this is extremely hard (one has to dump traces of all threads and look for deadlocking conditions on the same memory ranges), sanity only testing was performed.
This passed on kmod-kvdo-6.1.1.120-2.el7.

Comment 7 errata-xmlrpc 2018-10-30 09:39:31 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/RHBA-2018:3094


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