Vulnerabilities > CVE-2016-9754 - Integer Overflow or Wraparound vulnerability in Linux Kernel

047910
CVSS 7.8 - HIGH
Attack vector
LOCAL
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
local
low complexity
linux
CWE-190
nessus

Summary

The ring_buffer_resize function in kernel/trace/ring_buffer.c in the profiling subsystem in the Linux kernel before 4.6.1 mishandles certain integer calculations, which allows local users to gain privileges by writing to the /sys/kernel/debug/tracing/buffer_size_kb file.

Vulnerable Configurations

Part Description Count
OS
Linux
578

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Forced Integer Overflow
    This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.

Nessus

  • NASL familyHuawei Local Security Checks
    NASL idEULEROS_SA-2019-1472.NASL
    descriptionAccording to the versions of the kernel packages installed, the EulerOS Virtualization for ARM 64 installation on the remote host is affected by the following vulnerabilities : - The hid_input_field() function in
    last seen2020-03-19
    modified2019-05-13
    plugin id124796
    published2019-05-13
    reporterThis script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/124796
    titleEulerOS Virtualization for ARM 64 3.0.1.0 : kernel (EulerOS-SA-2019-1472)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(124796);
      script_version("1.6");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/19");
    
      script_cve_id(
        "CVE-2013-2892",
        "CVE-2014-2568",
        "CVE-2014-7843",
        "CVE-2014-9420",
        "CVE-2014-9529",
        "CVE-2014-9730",
        "CVE-2016-2070",
        "CVE-2016-2383",
        "CVE-2016-3134",
        "CVE-2016-4568",
        "CVE-2016-6327",
        "CVE-2016-7915",
        "CVE-2016-9754",
        "CVE-2017-16525",
        "CVE-2017-18079",
        "CVE-2017-18204",
        "CVE-2017-7261",
        "CVE-2017-9605",
        "CVE-2018-1094",
        "CVE-2018-16276"
      );
      script_bugtraq_id(
        62049,
        66348,
        71082,
        71717,
        71880,
        74964
      );
    
      script_name(english:"EulerOS Virtualization for ARM 64 3.0.1.0 : kernel (EulerOS-SA-2019-1472)");
      script_summary(english:"Checks the rpm output for the updated packages.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote EulerOS Virtualization for ARM 64 host is missing multiple security
    updates.");
      script_set_attribute(attribute:"description", value:
    "According to the versions of the kernel packages installed, the
    EulerOS Virtualization for ARM 64 installation on the remote host is
    affected by the following vulnerabilities :
    
      - The hid_input_field() function in
        'drivers/hid/hid-core.c' in the Linux kernel before 4.6
        allows physically proximate attackers to obtain
        sensitive information from kernel memory or cause a
        denial of service (out-of-bounds read) by connecting a
        device.(CVE-2016-7915i1/4%0
    
      - The Linux kernel, before version 4.14.2, is vulnerable
        to a deadlock caused by
        fs/ocfs2/file.c:ocfs2_setattr(), as the function does
        not wait for DIO requests before locking the inode.
        This can be exploited by local users to cause a
        subsequent denial of service.(CVE-2017-18204i1/4%0
    
      - The vmw_gb_surface_define_ioctl function (accessible
        via DRM_IOCTL_VMW_GB_SURFACE_CREATE) in
        drivers/gpu/drm/vmwgfx/vmwgfx_surface.c in the Linux
        kernel through 4.11.4 defines a backup_handle variable
        but does not give it an initial value. If one attempts
        to create a GB surface, with a previously allocated DMA
        buffer to be used as a backup buffer, the backup_handle
        variable does not get written to and is then later
        returned to user space, allowing local users to obtain
        sensitive information from uninitialized kernel memory
        via a crafted ioctl call.(CVE-2017-9605i1/4%0
    
      - Use-after-free vulnerability in the nfqnl_zcopy
        function in net/netfilter/nfnetlink_queue_core.c in the
        Linux kernel through 3.13.6 allows attackers to obtain
        sensitive information from kernel memory by leveraging
        the absence of a certain orphaning operation. NOTE: the
        affected code was moved to the skb_zerocopy function in
        net/core/skbuff.c before the vulnerability was
        announced.(CVE-2014-2568i1/4%0
    
      - It was found that the Linux kernel's ISO file system
        implementation did not correctly limit the traversal of
        Rock Ridge extension Continuation Entries (CE). An
        attacker with physical access to the system could use
        this flaw to trigger an infinite loop in the kernel,
        resulting in a denial of service.(CVE-2014-9420i1/4%0
    
      - An integer overflow vulnerability was found in the
        ring_buffer_resize() calculations in which a privileged
        user can adjust the size of the ringbuffer message
        size. These calculations can create an issue where the
        kernel memory allocator will not allocate the correct
        count of pages yet expect them to be usable. This can
        lead to the ftrace() output to appear to corrupt kernel
        memory and possibly be used for privileged escalation
        or more likely kernel panic.(CVE-2016-9754i1/4%0
    
      - A symlink size validation was missing in Linux kernels
        built with UDF file system (CONFIG_UDF_FS) support,
        allowing the corruption of kernel memory. An attacker
        able to mount a corrupted/malicious UDF file system
        image could cause the kernel to crash.(CVE-2014-9730i1/4%0
    
      - In was found that in the Linux kernel, in
        vmw_surface_define_ioctl() function in
        'drivers/gpu/drm/vmwgfx/vmwgfx_surface.c' file, a
        'num_sizes' parameter is assigned a user-controlled
        value which is not checked if it is zero. This is used
        in a call to kmalloc() and later leads to dereferencing
        ZERO_SIZE_PTR, which in turn leads to a GPF and
        possibly to a kernel panic.(CVE-2017-7261i1/4%0
    
      - A race condition flaw was found in the way the Linux
        kernel keys management subsystem performed key garbage
        collection. A local attacker could attempt accessing a
        key while it was being garbage collected, which would
        cause the system to crash.(CVE-2014-9529i1/4%0
    
      - A flaw was found in the Linux kernel's implementation
        of i8042 serial ports. An attacker could cause a kernel
        panic if they are able to add and remove devices as the
        module is loaded.(CVE-2017-18079i1/4%0
    
      - drivers/hid/hid-pl.c in the Human Interface Device
        (HID) subsystem in the Linux kernel through 3.11, when
        CONFIG_HID_PANTHERLORD is enabled, allows physically
        proximate attackers to cause a denial of service
        (heap-based out-of-bounds write) via a crafted
        device.(CVE-2013-2892i1/4%0
    
      - The __clear_user function in
        arch/arm64/lib/clear_user.S in the Linux kernel before
        3.17.4 on the ARM64 platform allows local users to
        cause a denial of service (system crash) by reading one
        byte beyond a /dev/zero page boundary.(CVE-2014-7843i1/4%0
    
      - A divide-by-zero vulnerability was found in a way the
        kernel processes TCP connections. The error can occur
        if a connection starts another cwnd reduction phase by
        setting tp-i1/4zprior_cwnd to the current cwnd (0) in
        tcp_init_cwnd_reduction(). A remote, unauthenticated
        attacker could use this flaw to crash the kernel
        (denial of service).(CVE-2016-2070i1/4%0
    
      - The adjust_branches function in kernel/bpf/verifier.c
        in the Linux kernel before 4.5 does not consider the
        delta in the backward-jump case, which allows local
        users to obtain sensitive information from kernel
        memory by creating a packet filter and then loading
        crafted BPF instructions.(CVE-2016-2383i1/4%0
    
      - System using the infiniband support module ib_srpt were
        vulnerable to a denial of service by system crash by a
        local attacker who is able to abort writes to a device
        using this initiator.(CVE-2016-6327i1/4%0
    
      - A security flaw was found in the Linux kernel in the
        mark_source_chains() function in
        'net/ipv4/netfilter/ip_tables.c'. It is possible for a
        user-supplied 'ipt_entry' structure to have a large
        'next_offset' field. This field is not bounds checked
        prior to writing to a counter value at the supplied
        offset.(CVE-2016-3134i1/4%0
    
      - An out-of-bounds access issue was discovered in
        yurex_read() in drivers/usb/misc/yurex.c in the Linux
        kernel. A local attacker could use user access
        read/writes with incorrect bounds checking in the yurex
        USB driver to crash the kernel or potentially escalate
        privileges.(CVE-2018-16276i1/4%0
    
      - drivers/media/v4l2-core/videobuf2-v4l2.c in the Linux
        kernel before 4.5.3 allows local users to cause a
        denial of service (kernel memory write operation) or
        possibly have unspecified other impact via a crafted
        number of planes in a VIDIOC_DQBUF ioctl
        call.(CVE-2016-4568i1/4%0
    
      - The usb_serial_console_disconnect function in
        drivers/usb/serial/console.c in the Linux kernel,
        before 4.13.8, allows local users to cause a denial of
        service (use-after-free and system crash) or possibly
        have unspecified other impact via a crafted USB device,
        related to disconnection and failed
        setup.(CVE-2017-16525i1/4%0
    
      - The Linux kernel is vulnerable to a NULL pointer
        dereference in the ext4/xattr.c:ext4_xattr_inode_hash()
        function. An attacker could trick a legitimate user or
        a privileged attacker could exploit this to cause a
        NULL pointer dereference with a crafted ext4 image.
        (CVE-2018-1094)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the EulerOS security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues.");
      # https://developer.huaweicloud.com/ict/en/site-euleros/euleros/security-advisories/EulerOS-SA-2019-1472
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?349d271e");
      script_set_attribute(attribute:"solution", value:
    "Update the affected kernel packages.");
      script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-16276");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2019/05/09");
      script_set_attribute(attribute:"plugin_publication_date", value:"2019/05/13");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-headers");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-tools");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-tools-libs");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:kernel-tools-libs-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:perf");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:huawei:euleros:python-perf");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:huawei:euleros:uvp:3.0.1.0");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"Huawei Local Security Checks");
    
      script_copyright(english:"This script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/EulerOS/release", "Host/EulerOS/rpm-list", "Host/EulerOS/uvp_version");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    
    release = get_kb_item("Host/EulerOS/release");
    if (isnull(release) || release !~ "^EulerOS") audit(AUDIT_OS_NOT, "EulerOS");
    uvp = get_kb_item("Host/EulerOS/uvp_version");
    if (uvp != "3.0.1.0") audit(AUDIT_OS_NOT, "EulerOS Virtualization 3.0.1.0");
    if (!get_kb_item("Host/EulerOS/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "aarch64" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "EulerOS", cpu);
    if ("aarch64" >!< cpu) audit(AUDIT_ARCH_NOT, "aarch64", cpu);
    
    flag = 0;
    
    pkgs = ["kernel-4.19.28-1.2.117",
            "kernel-devel-4.19.28-1.2.117",
            "kernel-headers-4.19.28-1.2.117",
            "kernel-tools-4.19.28-1.2.117",
            "kernel-tools-libs-4.19.28-1.2.117",
            "kernel-tools-libs-devel-4.19.28-1.2.117",
            "perf-4.19.28-1.2.117",
            "python-perf-4.19.28-1.2.117"];
    
    foreach (pkg in pkgs)
      if (rpm_check(release:"EulerOS-2.0", reference:pkg)) flag++;
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_HOLE,
        extra      : rpm_report_get()
      );
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "kernel");
    }
    
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-3422-1.NASL
    descriptionIt was discovered that a buffer overflow existed in the Bluetooth stack of the Linux kernel when handling L2CAP configuration responses. A physically proximate attacker could use this to cause a denial of service (system crash). (CVE-2017-1000251) It was discovered that the asynchronous I/O (aio) subsystem of the Linux kernel did not properly set permissions on aio memory mappings in some situations. An attacker could use this to more easily exploit other vulnerabilities. (CVE-2016-10044) Baozeng Ding and Andrey Konovalov discovered a race condition in the L2TPv3 IP Encapsulation implementation in the Linux kernel. A local attacker could use this to cause a denial of service (system crash) or possibly execute arbitrary code. (CVE-2016-10200) Andreas Gruenbacher and Jan Kara discovered that the filesystem implementation in the Linux kernel did not clear the setgid bit during a setxattr call. A local attacker could use this to possibly elevate group privileges. (CVE-2016-7097) Sergej Schumilo, Ralf Spenneberg, and Hendrik Schwartke discovered that the key management subsystem in the Linux kernel did not properly allocate memory in some situations. A local attacker could use this to cause a denial of service (system crash). (CVE-2016-8650) Vlad Tsyrklevich discovered an integer overflow vulnerability in the VFIO PCI driver for the Linux kernel. A local attacker with access to a vfio PCI device file could use this to cause a denial of service (system crash) or possibly execute arbitrary code. (CVE-2016-9083, CVE-2016-9084) It was discovered that an information leak existed in __get_user_asm_ex() in the Linux kernel. A local attacker could use this to expose sensitive information. (CVE-2016-9178) CAI Qian discovered that the sysctl implementation in the Linux kernel did not properly perform reference counting in some situations. An unprivileged attacker could use this to cause a denial of service (system hang). (CVE-2016-9191) It was discovered that the keyring implementation in the Linux kernel in some situations did not prevent special internal keyrings from being joined by userspace keyrings. A privileged local attacker could use this to bypass module verification. (CVE-2016-9604) It was discovered that an integer overflow existed in the trace subsystem of the Linux kernel. A local privileged attacker could use this to cause a denial of service (system crash). (CVE-2016-9754) Andrey Konovalov discovered that the IPv4 implementation in the Linux kernel did not properly handle invalid IP options in some situations. An attacker could use this to cause a denial of service or possibly execute arbitrary code. (CVE-2017-5970) Dmitry Vyukov discovered that the Linux kernel did not properly handle TCP packets with the URG flag. A remote attacker could use this to cause a denial of service. (CVE-2017-6214) It was discovered that a race condition existed in the AF_PACKET handling code in the Linux kernel. A local attacker could use this to cause a denial of service (system crash) or possibly execute arbitrary code. (CVE-2017-6346) It was discovered that the keyring implementation in the Linux kernel did not properly restrict searches for dead keys. A local attacker could use this to cause a denial of service (system crash). (CVE-2017-6951) Dmitry Vyukov discovered that the generic SCSI (sg) subsystem in the Linux kernel contained a stack-based buffer overflow. A local attacker with access to an sg device could use this to cause a denial of service (system crash) or possibly execute arbitrary code. (CVE-2017-7187) Eric Biggers discovered a memory leak in the keyring implementation in the Linux kernel. A local attacker could use this to cause a denial of service (memory consumption). (CVE-2017-7472) It was discovered that a buffer overflow existed in the Broadcom FullMAC WLAN driver in the Linux kernel. A local attacker could use this to cause a denial of service (system crash) or possibly execute arbitrary code. (CVE-2017-7541). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-05
    modified2017-09-19
    plugin id103326
    published2017-09-19
    reporterUbuntu Security Notice (C) 2017-2020 Canonical, Inc. / NASL script (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/103326
    titleUbuntu 14.04 LTS : linux vulnerabilities (USN-3422-1) (BlueBorne)
  • NASL familyHuawei Local Security Checks
    NASL idEULEROS_SA-2019-1498.NASL
    descriptionAccording to the versions of the kernel packages installed, the EulerOS Virtualization installation on the remote host is affected by the following vulnerabilities : - An integer overflow vulnerability was found in the ring_buffer_resize() calculations in which a privileged user can adjust the size of the ringbuffer message size. These calculations can create an issue where the kernel memory allocator will not allocate the correct count of pages yet expect them to be usable. This can lead to the ftrace() output to appear to corrupt kernel memory and possibly be used for privileged escalation or more likely kernel panic.(CVE-2016-9754) - A flaw was found in the Linux kernel
    last seen2020-06-12
    modified2019-05-13
    plugin id124821
    published2019-05-13
    reporterThis script is Copyright (C) 2019-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/124821
    titleEulerOS Virtualization 3.0.1.0 : kernel (EulerOS-SA-2019-1498)
  • NASL familyPhotonOS Local Security Checks
    NASL idPHOTONOS_PHSA-2017-0001.NASL
    descriptionAn update of [openssh,linux,libxml2] packages for PhotonOS has been released.
    last seen2019-02-21
    modified2019-02-07
    plugin id111850
    published2018-08-17
    reporterTenable
    sourcehttps://www.tenable.com/plugins/index.php?view=single&id=111850
    titlePhoton OS 1.0: Libxml2 / Linux / Openssh PHSA-2017-0001 (deprecated)
  • NASL familyPhotonOS Local Security Checks
    NASL idPHOTONOS_PHSA-2017-0001_LINUX.NASL
    descriptionAn update of the linux package has been released.
    last seen2020-06-01
    modified2020-06-02
    plugin id121664
    published2019-02-07
    reporterThis script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/121664
    titlePhoton OS 1.0: Linux PHSA-2017-0001