Skip to content
Heist/ feed
Back to feed
HighFix available

io_uring/net: fix overflow check in io_recvmsg_mshot_prep()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: io_uring/net: fix overflow check in io_recvmsg_mshot_prep() The "controllen" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow. The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an overflow. However, if we cast "controllen" to an int and it turns negative, then negative values *can* fit into an int type so there is no overflow. Good: 100 + (unsigned long)-4 = 96 <-- overflow Bad: 100 + (int)-4 = 96 <-- no overflow I deleted the cast of the sizeof() as well. That's not a bug but the cast is unnecessary.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.83, 6.6.23, 6.7.11, 6.8.2
CVEs
CVE-2024-35827
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 10:25 UTC · Revision 1

Source evidence

io_uring/net: fix overflow check in io_recvmsg_mshot_prep()

core-osv · Original source

Published 17 May 2024, 13:41 UTC

In the Linux kernel, the following vulnerability has been resolved: io_uring/net: fix overflow check in io_recvmsg_mshot_prep() The "controllen" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow. The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an overflow. However, if we cast "controllen" to an int and it turns negative, then negative values *can* fit into an int type so there is no overflow. Good: 100 + (unsigned long)-4 = 96 <-- overflow Bad: 100 + (int)-4 = 96 <-- no overflow I deleted the cast of the sizeof() as well. That's not a bug but the cast is unnecessary.

osv:CVE-2024-35827

Kernel

Fixed versions: 6.1.83, 6.6.23, 6.7.11, 6.8.2

Complete source record
{
  "id": "3268c86e9838534ad77dc7b9bca0bf94812768059b14336042911dee24795ae4",
  "url": "https://osv.dev/vulnerability/CVE-2024-35827",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "io_uring/net: fix overflow check in io_recvmsg_mshot_prep()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: io_uring/net: fix overflow check in io_recvmsg_mshot_prep() The \"controllen\" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow. The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an overflow. However, if we cast \"controllen\" to an int and it turns negative, then negative values *can* fit into an int type so there is no overflow. Good: 100 + (unsigned long)-4 = 96 <-- overflow Bad: 100 + (int)-4 = 96 <-- no overflow I deleted the cast of the sizeof() as well. That's not a bug but the cast is unnecessary.",
    "evidence": "osv:CVE-2024-35827",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.83",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.23",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.7.11",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.8.2",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2024-35827",
      "aliases": [
        "CVE-2024-35827"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "9b0fc3c054ff2eb13753104884f1045b5bb3a627"
                },
                {
                  "fixed": "868ec868616438df487b9e2baa5a99f8662cc47c"
                },
                {
                  "fixed": "59a534690ecc3af72c6ab121aeac1237a4adae66"
                },
                {
                  "fixed": "0c8c74bb59e7d77554016efc34c2d10376985e5e"
                },
                {
                  "fixed": "b6563ad0d599110bd5cf8f56c47d279c3ed796fe"
                },
                {
                  "fixed": "8ede3db5061bb1fe28e2c9683329aafa89d2b1b4"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-35827.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.0.0"
                },
                {
                  "fixed": "6.1.83"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.23"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.7.11"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.8.0"
                },
                {
                  "fixed": "6.8.2"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-35827.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:44.201349583Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/0c8c74bb59e7d77554016efc34c2d10376985e5e",
        "https://git.kernel.org/stable/c/59a534690ecc3af72c6ab121aeac1237a4adae66",
        "https://git.kernel.org/stable/c/868ec868616438df487b9e2baa5a99f8662cc47c",
        "https://git.kernel.org/stable/c/8ede3db5061bb1fe28e2c9683329aafa89d2b1b4",
        "https://git.kernel.org/stable/c/b6563ad0d599110bd5cf8f56c47d279c3ed796fe",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35827.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-35827",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/35xxx/CVE-2024-35827.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-35827",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 511618,
  "published_at": "2024-05-17T13:41:09.193+00:00"
}