Bug 1781894 (CVE-2019-19377)

Summary: CVE-2019-19377 kernel: use-after-free in btrfs_queue_work in fs/btrfs/async-thread.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, airlied, bdettelb, bhu, blc, brdeoliv, bskeggs, dhoward, dvlasenk, esammons, fhrbata, hdegoede, hkrzesin, iboverma, ichavero, itamar, jarodwilson, jeremy, jforbes, jlelli, john.j5live, jonathan, josef, jross, jshortt, jstancek, jwboyer, kernel-maint, kernel-mgr, lgoncalv, linville, masami256, mchehab, mcressma, mjg59, mlangsdo, nmurray, pmatouse, qzhao, rt-maint, rvrbovsk, steved, williams, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel's implementation of the BTRFS file system. A local attacker, with the ability to mount a file system, can create a use-after-free memory fault after the file system has been unmounted. This may lead to memory corruption or privilege escalation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-25 22:15:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1781895, 1819591, 1819592, 1819593, 1819594, 1819595    
Bug Blocks: 1781897    

Description Guilherme de Almeida Suckevicz 2019-12-10 20:44:12 UTC
A flaw was found in the Linux kernels implementation of the BTRFS file system.  A local attacker with the  ability to mount a file system can create a use-after-free after the file system has been unmounted.  This may lead to memory corruption or possibly privilege escalation.

Reference:
https://github.com/bobfuzzer/CVE/tree/master/CVE-2019-19377

Comment 1 Guilherme de Almeida Suckevicz 2019-12-10 20:45:22 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1781895]

Comment 11 Eric Christensen 2020-04-01 15:50:53 UTC
Mitigation:

As the btrfs module will be auto-loaded when required, its use can be disabled by preventing the module from loading with the following instructions:

# echo "install btrfs /bin/true" >> /etc/modprobe.d/disable-btrfs.conf 
 
The system will need to be restarted if the BTRFS modules are loaded. In most circumstances, the CIFS kernel modules will be unable to be unloaded while any network interfaces are active and the protocol is in use.

If the system requires this module to work correctly (as a filesytem required to run), this mitigation may not be suitable.

If you need further assistance, see KCS article https://access.redhat.com/solutions/41278 or contact Red Hat Global Support Services.

Comment 12 Petr Matousek 2020-04-03 04:34:23 UTC
Statement:

This flaw is rated as moderate, the attacker would need to have physical access or permission to mount/write to a filesystem to abuse this.  If they can write to a block device they can already do other evil things, like make a setuid binary etc.

Comment 14 Justin M. Forbes 2020-05-13 22:19:21 UTC
This was fixed for Fedora with the 5.5.18 stable kernel updates.