---
id: CVE-2024-42068
title: 'bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()'
summary: |-
  In the Linux kernel, the following vulnerability has been resolved:

  bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()

  set_memory_ro() can fail, leaving memory unprotected.

  Check its return and take it into acc…
severity: high
cvss: 7.8
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'
cvssSource: cna
vendor: Linux
product: Linux
affected:
  - >-
    Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 <
    a359696856ca9409fb97655c5a8ef0f549cb6e03
  - >-
    Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 <
    e4f602e3ff749ba770bf8ff10196e18358de6720
  - >-
    Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 <
    2bbfffa802adc30b772d0e0f881a13c3804a965c
  - >-
    Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 <
    05412471beba313ecded95aa17b25fe84bb2551a
  - >-
    Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 <
    7d2cc63eca0c993c99d18893214abf8f85d566d8
  - Linux 3.18
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2024-09-10T16:19:52.600102Z'
published: '2024-07-29'
updated: '2026-10-21'
sourceUpdated: '2026-10-21T12:34:58.185Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2024-42068'
references:
  - url: 'https://git.kernel.org/stable/c/a359696856ca9409fb97655c5a8ef0f549cb6e03'
  - url: 'https://git.kernel.org/stable/c/e4f602e3ff749ba770bf8ff10196e18358de6720'
  - url: 'https://git.kernel.org/stable/c/2bbfffa802adc30b772d0e0f881a13c3804a965c'
  - url: 'https://git.kernel.org/stable/c/05412471beba313ecded95aa17b25fe84bb2551a'
  - url: 'https://git.kernel.org/stable/c/7d2cc63eca0c993c99d18893214abf8f85d566d8'
tags:
  - cve.org
epss: 0.00305
epssPercentile: 0.23189
ingestedAt: '2026-10-21T12:48:53.734Z'
---

## Overview

In the Linux kernel, the following vulnerability has been resolved:

bpf: Take return from set_memory_ro() into account with bpf_prog_lock_ro()

set_memory_ro() can fail, leaving memory unprotected.

Check its return and take it into account as an error.

## Affected

- `Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 < a359696856ca9409fb97655c5a8ef0f549cb6e03`
- `Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 < e4f602e3ff749ba770bf8ff10196e18358de6720`
- `Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 < 2bbfffa802adc30b772d0e0f881a13c3804a965c`
- `Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 < 05412471beba313ecded95aa17b25fe84bb2551a`
- `Linux >= 60a3b2253c413cf601783b070507d7dd6620c954 < 7d2cc63eca0c993c99d18893214abf8f85d566d8`
- `Linux 3.18`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
