Bug 1854089 - CVE-2020-14314 kernel: buffer uses out of index in ext3/4 filesystem [fedora-all]
Summary: CVE-2020-14314 kernel: buffer uses out of index in ext3/4 filesystem [fedora-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 32
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: CVE-2020-14314
TreeView+ depends on / blocked
 
Reported: 2020-07-06 11:25 UTC by Alex
Modified: 2020-10-08 19:11 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-08 19:11:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alex 2020-07-06 11:25:04 UTC
This is an automatically created tracking bug!  It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.

For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.

For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs

When submitting as an update, use the fedpkg template provided in the next
comment(s).  This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.

Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.

NOTE: this issue affects multiple supported versions of Fedora. While only
one tracking bug has been filed, please correct all affected versions at
the same time.  If you need to fix the versions independent of each other,
you may clone this bug as appropriate.

Reproducers, if any, will remain confidential and never be made public, unless done so by the security team.

Comment 1 Alex 2020-07-06 11:25:13 UTC
Use the following template to for the 'fedpkg update' request to submit an
update for this issue as it contains the top-level parent bug(s) as well as
this tracking bug.  This will ensure that all associated bugs get updated
when new packages are pushed to stable.

=====

# bugfix, security, enhancement, newpackage (required)
type=security

# low, medium, high, urgent (required)
severity=medium

# testing, stable
request=testing

# Bug numbers: 1234,9876
bugs=1853922,1854089

# Description of your update
notes=Security fix for [PUT CVEs HERE]

# Enable request automation based on the stable/unstable karma thresholds
autokarma=True
stable_karma=3
unstable_karma=-3

# Automatically close bugs when this marked as stable
close_bugs=True

# Suggest that users restart after update
suggest_reboot=False

======

Additionally, you may opt to use the bodhi web interface to submit updates:

https://bodhi.fedoraproject.org/updates/new

Comment 2 Alex 2020-07-06 11:53:42 UTC
See https://access.redhat.com/solutions/5151471
and BZ tickets for rhel*:
8 : 1846165
7 : 1846164
6 : 1843333
, also shorter description (taken from http://localhost:5600/static/#/flaw/1853922 ):
"
Starting from commit ef2b02d3e617cb0400eedf2668f86215e1b0e6af, it could be failure of disk operation for directory using ext3/ext4 fs.
The bug is in the directory indexing code, and occurs when adding certain directory entries (new files/directories) in affected directories (with read memory out of bounds).
The bug exists in all supported RHEL releases (RHEL 6, RHEL 7, RHEL 8), as well as the upstream kernel.
Needs to be some specific content of FS block with directory indexes for reproducing this fail (known way of reproducing is taking existing image that leads to this bug and then run the command touch for some specific file of this image that is inside broken directory).
The workaround to fix the bug is command e2fsck with params -Df for the partition (or image) that have this failure.
Currently patch available:

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a8aca4772aaa..c09cf7043702 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1870,6 +1870,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
 	}
 	/* map index at which we will split */
 	split = count - move;
+	if (!split) split = count/2;
 	hash2 = map[split].hash;
 	continued = hash2 == map[split - 1].hash;
 	dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
"

And some more info here:
https://lore.kernel.org/linux-ext4/f53e246b-647c-64bb-16ec-135383c70ad7@redhat.com/T/#u
(and the patch is similar to the one above, but with the code:

-	/* map index at which we will split */
-	split = count - move;
+	/*
+	 * map index at which we will split
+	 *
+	 * If the sum of active entries didn't exceed half the block size, just
+	 * split it in half by count; each resulting block will have at least
+	 * half the space free.
+	 */
+	if (i > 0)
+		split = count - move;
+	else
+		split = count/2;
+

)

Comment 3 Justin M. Forbes 2020-10-08 19:11:36 UTC
This was fixed for Fedora with the 5.7.18 stable kernel updates


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