# CVE-2022-50516: fs: dlm: fix invalid derefence of sb\_lvbptr

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 9, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-10-07T15:19:11.657Z
- **Modified:** 2026-06-17T05:23:42.303Z

## Who should check

- Anyone running Linux \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ef3033b435a6bac547166b793025578fab2f9df3; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ea7be82fd7e1f5de72208bce93fbbe6de6c13dec; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 1ab6d3030652b5de0015176a5b0ad9df9b847514; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 7175e131ebba47afef47e6ac4d5bab474d1e6e49
- Anyone running Linux 2.6.19

## Description

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

fs: dlm: fix invalid derefence of sb\_lvbptr

I experience issues when putting a lkbsb on the stack and have sb\_lvbptr
field to a dangled pointer while not using DLM\_LKF\_VALBLK. It will crash
with the following kernel message, the dangled pointer is here
0xdeadbeef as example:

\[  102.749317\] BUG: unable to handle page fault for address: 00000000deadbeef
\[  102.749320\] \#PF: supervisor read access in kernel mode
\[  102.749323\] \#PF: error\_code(0x0000) - not-present page
\[  102.749325\] PGD 0 P4D 0
\[  102.749332\] Oops: 0000 \[\#1\] PREEMPT SMP PTI
\[  102.749336\] CPU: 0 PID: 1567 Comm: lock\_torture\_wr Tainted: G        W         5.19.0-rc3+ \#1565
\[  102.749343\] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.16.0-2.module+el8.7.0+15506+033991b0 04/01/2014
\[  102.749344\] RIP: 0010:memcpy\_erms+0x6/0x10
\[  102.749353\] Code: cc cc cc cc eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 \<f3\> a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe
\[  102.749355\] RSP: 0018:ffff97a58145fd08 EFLAGS: 00010202
\[  102.749358\] RAX: ffff901778b77070 RBX: 0000000000000000 RCX: 0000000000000040
\[  102.749360\] RDX: 0000000000000040 RSI: 00000000deadbeef RDI: ffff901778b77070
\[  102.749362\] RBP: ffff97a58145fd10 R08: ffff901760b67a70 R09: 0000000000000001
\[  102.749364\] R10: ffff9017008e2cb8 R11: 0000000000000001 R12: ffff901760b67a70
\[  102.749366\] R13: ffff901760b78f00 R14: 0000000000000003 R15: 0000000000000001
\[  102.749368\] FS:  0000000000000000(0000) GS:ffff901876e00000(0000) knlGS:0000000000000000
\[  102.749372\] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[  102.749374\] CR2: 00000000deadbeef CR3: 000000017c49a004 CR4: 0000000000770ef0
\[  102.749376\] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
\[  102.749378\] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
\[  102.749379\] PKRU: 55555554
\[  102.749381\] Call Trace:
\[  102.749382\]  \<TASK\>
\[  102.749383\]  ? send\_args+0xb2/0xd0
\[  102.749389\]  send\_common+0xb7/0xd0
\[  102.749395\]  \_unlock\_lock+0x2c/0x90
\[  102.749400\]  unlock\_lock.isra.56+0x62/0xa0
\[  102.749405\]  dlm\_unlock+0x21e/0x330
\[  102.749411\]  ? lock\_torture\_stats+0x80/0x80 \[dlm\_locktorture\]
\[  102.749416\]  torture\_unlock+0x5a/0x90 \[dlm\_locktorture\]
\[  102.749419\]  ? preempt\_count\_sub+0xba/0x100
\[  102.749427\]  lock\_torture\_writer+0xbd/0x150 \[dlm\_locktorture\]
\[  102.786186\]  kthread+0x10a/0x130
\[  102.786581\]  ? kthread\_complete\_and\_exit+0x20/0x20
\[  102.787156\]  ret\_from\_fork+0x22/0x30
\[  102.787588\]  \</TASK\>
\[  102.787855\] Modules linked in: dlm\_locktorture torture rpcsec\_gss\_krb5 intel\_rapl\_msr intel\_rapl\_common kvm\_intel iTCO\_wdt iTCO\_vendor\_support kvm vmw\_vsock\_virtio\_transport qxl irqbypass vmw\_vsock\_virtio\_transport\_common drm\_ttm\_helper crc32\_pclmul joydev crc32c\_intel ttm vsock virtio\_scsi virtio\_balloon snd\_pcm drm\_kms\_helper virtio\_console snd\_timer snd drm soundcore syscopyarea i2c\_i801 sysfillrect sysimgblt i2c\_smbus pcspkr fb\_sys\_fops lpc\_ich serio\_raw
\[  102.792536\] CR2: 00000000deadbeef
\[  102.792930\] ---\[ end trace 0000000000000000 \]---

This patch fixes the issue by checking also on DLM\_LKF\_VALBLK on exflags
is set when copying the lvbptr array instead of if it's just null which
fixes for me the issue.

I think this patch can fix other dlm users as well, depending how they
handle the init, freeing memory handling of sb\_lvbptr and don't set
DLM\_LKF\_VALBLK for some dlm\_lock() calls. It might a there could be a
hidden issue all the time. However with checking on DLM\_LKF\_VALBLK the
user always need to provide a sb\_lvbptr non-null value. There might be
more intelligent handling between per ls lvblen, DLM\_LKF\_VALBLK and
non-null to report the user the way how DLM API is used is wrong but can
be added for later, this will only fix the current behaviour.

## Affected and fixed versions

- Linux: \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ef3033b435a6bac547166b793025578fab2f9df3; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ea7be82fd7e1f5de72208bce93fbbe6de6c13dec; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 1ab6d3030652b5de0015176a5b0ad9df9b847514; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 7175e131ebba47afef47e6ac4d5bab474d1e6e49 (cvelist)
- Linux: 2.6.19 (cvelist)

## Mitigation

- Upgrade Linux to 7175e131ebba47afef47e6ac4d5bab474d1e6e49 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50516. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50516.md
Affected: Linux >= e7fd41792fc0ee52a05fcaac87511f118328d147, < ef3033b435a6bac547166b793025578fab2f9df3; >= e7fd41792fc0ee52a05fcaac87511f118328d147, < ea7be82fd7e1f5de72208bce93fbbe6de6c13dec; >= e7fd41792fc0ee52a05fcaac87511f118328d147, < 1ab6d3030652b5de0015176a5b0ad9df9b847514; >= e7fd41792fc0ee52a05fcaa…
Fixed in: Linux 1ab6d3030652b5de0015176a5b0ad9df9b847514, Linux 57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30, Linux 7175e131ebba47afef47e6ac4d5bab474d1e6e49

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50516 being exploited?

There is no confirmed exploitation: CVE-2022-50516 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50516?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50516?

Linux \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ef3033b435a6bac547166b793025578fab2f9df3; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< ea7be82fd7e1f5de72208bce93fbbe6de6c13dec; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 1ab6d3030652b5de0015176a5b0ad9df9b847514; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30; \>= e7fd41792fc0ee52a05fcaac87511f118328d147, \< 7175e131ebba47afef47e6ac4d5bab474d1e6e49; Linux 2.6.19.

### Is there a fix for CVE-2022-50516?

Yes. Fixed in Linux 1ab6d3030652b5de0015176a5b0ad9df9b847514, Linux 57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30, Linux 7175e131ebba47afef47e6ac4d5bab474d1e6e49. Upgrade Linux to 7175e131ebba47afef47e6ac4d5bab474d1e6e49 or later.

### How do I check if I'm affected by CVE-2022-50516?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/ef3033b435a6bac547166b793025578fab2f9df3>
- patch: <https://git.kernel.org/stable/c/ea7be82fd7e1f5de72208bce93fbbe6de6c13dec>
- patch: <https://git.kernel.org/stable/c/1ab6d3030652b5de0015176a5b0ad9df9b847514>
- patch: <https://git.kernel.org/stable/c/57c1cfb5781068e5d3632bc6e5f74a8fcc4f1a30>
- patch: <https://git.kernel.org/stable/c/7175e131ebba47afef47e6ac4d5bab474d1e6e49>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50516>

HTML: <https://flawdb.com/CVE-2022-50516> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50516>
