Skip to content
Heist/ feed
Back to feed
HighFix available

iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL If we fail to copy the just created file descriptor to userland, we try to clean up by putting back 'fd' and freeing 'ib'. The code uses put_unused_fd() for the former which is wrong, as the file descriptor was already published by fd_install() which gets called internally by anon_inode_getfd(). This makes the error handling code leaving a half cleaned up file descriptor table around and a partially destructed 'file' object, allowing userland to play use-after-free tricks on us, by abusing the still usable fd and making the code operate on a dangling 'file->private_data' pointer. Instead of leaving the kernel in a partially corrupted state, don't attempt to explicitly clean up and leave this to the process exit path that'll release any still valid fds, including the one created by the previous call to anon_inode_getfd(). Simply return -EFAULT to indicate the error.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.24, 5.16.10
CVEs
CVE-2022-48801
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 15:40 UTC · Revision 1

Source evidence

iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL

core-osv · Original source

Published 16 Jul 2024, 11:43 UTC

In the Linux kernel, the following vulnerability has been resolved: iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL If we fail to copy the just created file descriptor to userland, we try to clean up by putting back 'fd' and freeing 'ib'. The code uses put_unused_fd() for the former which is wrong, as the file descriptor was already published by fd_install() which gets called internally by anon_inode_getfd(). This makes the error handling code leaving a half cleaned up file descriptor table around and a partially destructed 'file' object, allowing userland to play use-after-free tricks on us, by abusing the still usable fd and making the code operate on a dangling 'file->private_data' pointer. Instead of leaving the kernel in a partially corrupted state, don't attempt to explicitly clean up and leave this to the process exit path that'll release any still valid fds, including the one created by the previous call to anon_inode_getfd(). Simply return -EFAULT to indicate the error.

osv:CVE-2022-48801

Kernel

Fixed versions: 5.15.24, 5.16.10

Complete source record
{
  "id": "9688c7c2e4ae9d4b3296862f5ca5e29943d7875a6af7bffd23754bfed843dd4e",
  "url": "https://osv.dev/vulnerability/CVE-2022-48801",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL If we fail to copy the just created file descriptor to userland, we try to clean up by putting back 'fd' and freeing 'ib'. The code uses put_unused_fd() for the former which is wrong, as the file descriptor was already published by fd_install() which gets called internally by anon_inode_getfd(). This makes the error handling code leaving a half cleaned up file descriptor table around and a partially destructed 'file' object, allowing userland to play use-after-free tricks on us, by abusing the still usable fd and making the code operate on a dangling 'file->private_data' pointer. Instead of leaving the kernel in a partially corrupted state, don't attempt to explicitly clean up and leave this to the process exit path that'll release any still valid fds, including the one created by the previous call to anon_inode_getfd(). Simply return -EFAULT to indicate the error.",
    "evidence": "osv:CVE-2022-48801",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.24",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.16.10",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-48801",
      "aliases": [
        "CVE-2022-48801"
      ],
      "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": "f73f7f4da581875f9b1f2fb8ebd1ab15ed634488"
                },
                {
                  "fixed": "b7f54894aa7517d2b6c797a499b9f491e9db9083"
                },
                {
                  "fixed": "202071d2518537866d291aa7cf26af54e674f4d4"
                },
                {
                  "fixed": "c72ea20503610a4a7ba26c769357d31602769c01"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48801.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.13.0"
                },
                {
                  "fixed": "5.15.24"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "5.16.10"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48801.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:30.102307279Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4",
        "https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083",
        "https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48801.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-48801",
        "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/2022/48xxx/CVE-2022-48801.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-48801",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 496923,
  "published_at": "2024-07-16T11:43:54.253+00:00"
}