Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Sunday January 23 2022, @07:18PM   Printer-friendly
from the we-are-not-talking-about-popcorn dept.

In this one, there's a heap overflow bug in the legacy_parse_param in the Linux kernel's fs/fs_context.c program. This parameter is used in Linux filesystems during superblock creation for mount and superblock reconfiguration for a remount. The superblock records all of a filesystem's characteristics such as file size, block size, empty and filled storage blocks. So, yeah, it's important.

The legacy_parse_param() "PAGE_SIZE - 2 - size" calculation was mistakenly made anunsigned type. This means a large value of "size" results in a high positive value instead of a negative value as expected. Whoops.

This, in turn, meant you copy data beyond the memory slab allocated for it. And, as all programmers know, writing beyond the memory your program is supposed to have access to is a terrible thing.

[...] So, how bad is it? By the Common Vulnerability Scoring System (CVSS) v3.1 scoring test, it's a solid 7.7. That's considered a high-security vulnerability.

A local attacker can use it to escalate their user privileges or crash the system. This can be done with a specially crafted program that triggers this integer overflow. That done, it's trivial to execute arbitrary code and give the attacker root privileges.

To exploit it requires the CAP_SYS_ADMIN privilege to be enabled. If that's the case,  an unprivileged local user can open a filesystem that does not support the File System Context application programming interface (API). In this situation, it drops back to legacy handling, and from there, the flaw can escalate an attacker's system privileges.

[...] This security hole was introduced back on Feb 28, 2019, in the Linux 5.1-rc1 kernel. It's now present in all Linux kernels. Yes, all of them. Fortunately, the patch is in.


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: -1, Troll) by Anonymous Coward on Sunday January 23 2022, @07:24PM

    by Anonymous Coward on Sunday January 23 2022, @07:24PM (#1215068)

    Time for Schlomo and Chaim to put a new bug in its place!

  • (Score: -1, Troll) by Anonymous Coward on Sunday January 23 2022, @07:46PM

    by Anonymous Coward on Sunday January 23 2022, @07:46PM (#1215076)

    ass don't you.

  • (Score: 2, Touché) by Anonymous Coward on Sunday January 23 2022, @08:12PM (5 children)

    by Anonymous Coward on Sunday January 23 2022, @08:12PM (#1215081)

    This bug rated 7.7 on the same scale where systemd rated 8.9... that's pretty serious.

    • (Score: 3, Insightful) by Anonymous Coward on Sunday January 23 2022, @08:54PM (4 children)

      by Anonymous Coward on Sunday January 23 2022, @08:54PM (#1215090)

      Difference is they fixed this bug but systemd is still open.

      • (Score: 3, Funny) by Anonymous Coward on Sunday January 23 2022, @09:24PM (2 children)

        by Anonymous Coward on Sunday January 23 2022, @09:24PM (#1215095)

        Not a bug, Will not fix so fuck you.
        -Poettering

        • (Score: 2, Touché) by Anonymous Coward on Sunday January 23 2022, @10:07PM (1 child)

          by Anonymous Coward on Sunday January 23 2022, @10:07PM (#1215108)

          Sounds like the KDE/Qt lot, now wanting to allow for ADS within applications in their framework. Or the Gnome devs who are desperate to copy Apple for no good reason (can't innovate, so copy the worst UI out there). Funny - Unity, Win8/10, Deepinn, Gnome 4 - all copying the Apple look.

          Why is it that devs are like politicians? The people scream they don't want A but really like B, so the deviticians force A and disable B.

          • (Score: 1, Informative) by Anonymous Coward on Monday January 24 2022, @12:38AM

            by Anonymous Coward on Monday January 24 2022, @12:38AM (#1215154)

            For the last time. the KDE project has *nothing* to do with adding an ad platform to Qt.

            Qt is a commercial business. KDE is only one downstream consumer.

      • (Score: 2, Interesting) by Anonymous Coward on Monday January 24 2022, @07:43PM

        by Anonymous Coward on Monday January 24 2022, @07:43PM (#1215346)

        You can get that bug fix here [devuan.org]

  • (Score: 5, Interesting) by gawdonblue on Sunday January 23 2022, @09:40PM (1 child)

    by gawdonblue (412) on Sunday January 23 2022, @09:40PM (#1215102)

    Which is the buggier bug:
    Using an unsigned int where a signed one was expected?
    or
    Using a signed int for how much memory you want?

    • (Score: 1, Interesting) by Anonymous Coward on Monday January 24 2022, @03:59AM

      by Anonymous Coward on Monday January 24 2022, @03:59AM (#1215187)

      using signed avoids having to worry about underflow. Some folks recommend using signed to avoid underflow concerns unless a damn good reason not to.

  • (Score: 2) by Mykl on Sunday January 23 2022, @10:23PM (5 children)

    by Mykl (1112) on Sunday January 23 2022, @10:23PM (#1215115)

    Is there any indication, based on the change log and actor history, about whether this was a genuine accident, or an intentional vulnerability introduced into the kernel?

    • (Score: 2, Informative) by Anonymous Coward on Sunday January 23 2022, @11:35PM (4 children)

      by Anonymous Coward on Sunday January 23 2022, @11:35PM (#1215145)

      Looks to be a simple oversight...

      -    if (len > PAGE_SIZE - 2 - size)
      +    if (size + len + 2 > PAGE_SIZE)

      • (Score: 5, Insightful) by https on Monday January 24 2022, @07:00AM (1 child)

        by https (5248) on Monday January 24 2022, @07:00AM (#1215218) Journal

        Maybe it's because FORTRAN was one of the first few languages I learned, (only one semester, thank $LC_DEITY), but the order of operations on variables where you have a rough idea of the value of has always been super important.

        If you're adding a array of floats, helps to sort first. Gratuitous example, try in ipython:

        In [81]: 0.4 + 0.2 + 0.3 + 0.1
        Out [81]: 1.0000000000000002
        In [82]: 0.1 + 0.2 + 0.3 + 0.4
        Out [82]: 1.0

        It's first-year-shit since decades ago: know the limits of your data types. While it may be an oversight, if I was on kernel team I'd be looking at other code this committer has touched for similar oopsies.

        --
        Offended and laughing about it.
        • (Score: 1, Interesting) by Anonymous Coward on Tuesday January 25 2022, @07:45AM

          by Anonymous Coward on Tuesday January 25 2022, @07:45AM (#1215523)

          That is a fun one on another level. I tried that test in different Python interpreters and 0.4 + 0.2 + 0.3 + 0.1 == 0.1 + 0.2 + 0.3 + 0.4 was sometimes True and sometimes False.

      • (Score: 2) by DrkShadow on Monday January 24 2022, @05:11PM (1 child)

        by DrkShadow (1404) on Monday January 24 2022, @05:11PM (#1215286)

        Simple oversight? How can this _change_ be justified? It looks benign, but why was this (intended-to-be) nothing-change made at all? It does nothing. It doesn't even increase clarity.

        I don't think it was malicious, but what justification was there for making this change? (I really hope it was in the midst of a lot of other modified code, in which case it could be just part of testing/working with code, and never changed back.)

        • (Score: 2) by maxwell demon on Monday January 24 2022, @07:03PM

          by maxwell demon (1608) on Monday January 24 2022, @07:03PM (#1215333) Journal

          That change was not the introduction of the bug, but the fix.

          --
          The Tao of math: The numbers you can count are not the real numbers.
  • (Score: 0) by Anonymous Coward on Sunday January 23 2022, @11:41PM

    by Anonymous Coward on Sunday January 23 2022, @11:41PM (#1215147)

    When do we get scorpions, or octopi, or lawn gnomes? How 'bout just a plain old cuttlefish?

  • (Score: 0) by Anonymous Coward on Monday January 24 2022, @12:13AM (4 children)

    by Anonymous Coward on Monday January 24 2022, @12:13AM (#1215152)

    To exploit it requires the CAP_SYS_ADMIN privilege to be enabled. [...] from there, the flaw can escalate an attacker's system privileges.

    Huh?

    • (Score: 0) by Anonymous Coward on Monday January 24 2022, @01:38AM (3 children)

      by Anonymous Coward on Monday January 24 2022, @01:38AM (#1215165)

      The attacker doesn't have to have CAP_SYS_ADMIN, the privilege just needs to be enabled in the system.

      • (Score: 4, Informative) by tekk on Monday January 24 2022, @02:53AM (2 children)

        by tekk (5704) Subscriber Badge on Monday January 24 2022, @02:53AM (#1215173)

        The program needs to be CAP_SYS_ADMIN, which can only be done by root.

        This is the kind of bug Raymond Chen over at Microsoft refers to as "other side of the airlock"

        • (Score: 1, Insightful) by Anonymous Coward on Monday January 24 2022, @05:25AM

          by Anonymous Coward on Monday January 24 2022, @05:25AM (#1215200)

          It's the "airtight hatchway." This bug isn't quite one of those because you could work your way around having to set CAP_SYS_ADMIN as root yourself, but it is pretty close to that level considering what executables you could count on having that capability and everything else that has to be set up just right for it to work.

        • (Score: 0) by Anonymous Coward on Wednesday January 26 2022, @02:27AM

          by Anonymous Coward on Wednesday January 26 2022, @02:27AM (#1215743)

          The program needs to be CAP_SYS_ADMIN, which can only be done by root.

          This is not accurate. Linux has a feature called "user namespaces" which allows unprivileged users to create processes that have CAP_SYS_ADMIN within the namespace. This is what allows unprivileged users to exploit the bug.

          Systems with the user namespaces feature disabled probably are not exploitable. In the past decade or so since user namespaces were introduced many reported exploits have used it, so I suggest turning it off on any system where it is not required.

  • (Score: 0, Flamebait) by Anonymous Coward on Monday January 24 2022, @10:41AM (1 child)

    by Anonymous Coward on Monday January 24 2022, @10:41AM (#1215232)

    Just found out only g++ includes -Wsign-compare in -Wall; for gcc you have to pass -Wsign-compare explicitly to get:

    warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]

    Or just use Rust instead:

    You can't borrow PAGE_SIZE, all the pages and all the sizes are belongs to us, fuck off you hetero-person!

    • (Score: 2) by bart9h on Monday January 24 2022, @12:27PM

      by bart9h (767) on Monday January 24 2022, @12:27PM (#1215236)

      Where's the "+1 Flamebait" mod when I need it?

(1)