Bug 2049700 (CVE-2022-0480)

Summary: CVE-2022-0480 kernel: memcg does not limit the number of POSIX file locks allowing memory exhaustion
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, bdettelb, bhu, chwhite, crwood, dvlasenk, eshatokhin, hdegoede, hkrzesin, jarod, jarodwilson, jburrell, jeremy, jfaracco, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jshortt, jstancek, jwboyer, kcarcia, kernel-maint, kernel-mgr, lgoncalv, linville, lzampier, masami256, mchehab, nmurray, ptalbert, qzhao, rkeshri, rvrbovsk, scweaver, steved, vkumar, walters, williams
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 filelock_init in fs/locks.c function in the Linux kernel. This issue can lead to host memory exhaustion due to memcg not limiting the number of Portable Operating System Interface (POSIX) file locks.
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 2049708, 2051677, 2051678, 2066600, 2066601, 2209993, 2209994, 2209995, 2209996, 2209997, 2209998    
Bug Blocks: 2040774, 2049704    

Description Guilherme de Almeida Suckevicz 2022-02-02 14:56:23 UTC
A flaw was found in filelock_init in fs/locks.c in the Linux kernel. In this flaw, A host memory exhaustion is possible because memcg does not limit the number of POSIX file locks.

Reference:
https://github.com/kata-containers/kata-containers/issues/3373
https://lore.kernel.org/linux-mm/20210902215519.AWcuVc3li%25akpm@linux-foundation.org/

Comment 1 Guilherme de Almeida Suckevicz 2022-02-02 15:01:06 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2049708]

Comment 4 juneau 2022-02-08 12:54:43 UTC
Marking Services notaffected per kernel analysis.

Comment 5 Justin M. Forbes 2022-02-10 22:03:42 UTC
This was fixed for Fedora with the 5.15.x stable kernel rebases.

Comment 6 Rohit Keshri 2022-03-20 18:39:20 UTC
Upstream has revered the fix with the following details:
***
commit 3754707bcc3e190e5dadc978d172b61e809cb3bd
Author: Linus Torvalds <torvalds>
Date:   Tue Sep 7 11:21:48 2021 -0700

    Revert "memcg: enable accounting for file lock caches"
    
    This reverts commit 0f12156dff2862ac54235fc72703f18770769042.
    
    The kernel test robot reports a sizeable performance regression for this
    commit, and while it clearly does the rigth thing in theory, we'll need
    to look at just how to avoid or minimize the performance overhead of the
    memcg accounting.
    
    People already have suggestions on how to do that, but it's "future
    work".
    
    So revert it for now.
    
    Link: https://lore.kernel.org/lkml/20210907150757.GE17617@xsang-OptiPlex-9020/
    Acked-by: Jens Axboe <axboe>
    Acked-by: Shakeel Butt <shakeelb>
    Acked-by: Roman Gushchin <guro>
    Cc: Tejun Heo <tj>
    Signed-off-by: Linus Torvalds <torvalds>
***

Comment 22 errata-xmlrpc 2024-03-12 00:42:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2024:1250 https://access.redhat.com/errata/RHSA-2024:1250

Comment 23 errata-xmlrpc 2024-03-13 00:13:24 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Extended Update Support

Via RHSA-2024:1303 https://access.redhat.com/errata/RHSA-2024:1303

Comment 24 errata-xmlrpc 2024-03-13 00:21:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Extended Update Support

Via RHSA-2024:1304 https://access.redhat.com/errata/RHSA-2024:1304

Comment 25 errata-xmlrpc 2024-03-13 09:07:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2024:1306 https://access.redhat.com/errata/RHSA-2024:1306