KernelScan.io

HIGH Introduced in 4.16

ov7740 Teardown UAF

CVE-2026-89887

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

In the Linux kernel, the following vulnerability has been resolved: media: i2c: ov7740: fix use-after-destroy in remove The ov7740_remove() function had a severe teardown order bug where it destroyed the driver's mutex before freeing the V4L2 control handler which relies on that mutex, leading to a use-after-destroy kernel panic. Furthermore, the driver explicitly called v4l2_ctrl_handler_free() and mutex_destroy() sequentially, but then called ov7740_free_controls() which invokes both of them a second time, resulting in a double-free. This patch fixes the issue by unregistering the subdevice first, and relying exclusively on ov7740_free_controls() to safely tear down the mutex and control handler in the correct order.

02

Engine v0.6.0

Risk summary

A teardown order bug in the OV7740 image sensor driver destroys a mutex before the V4L2 control handler that depends on it, then double-frees both, causing a kernel panic or memory corruption. Any local user with access to the I2C device can trigger it by unbinding the driver, leading to denial of service or potential privilege escalation.

Affecteddrivers/media/i2c/ov7740.c (media: i2c: ov7740 image sensor driver)

Vulnerability analysis

The OV7740 image sensor driver's remove function destroys a mutex before freeing the V4L2 control handler that relies on it, then calls a cleanup helper that frees both a second time, producing a use-after-destroy and double-free. The fix unregisters the subdevice first and delegates all teardown to the existing cleanup helper, which frees the control handler and destroys the mutex in the correct order. The bug is reachable locally by any user who can trigger device removal (e.g., via sysfs unbind) on a system with the OV7740 sensor driver loaded; no special privileges beyond access to the I2C device node are required.

03

BranchIntroducedFixed inPatch commit
5.104.165.10.2709e4693436c7d
5.154.165.15.22181e9765878d3
6.14.166.1.1888a02ee6c1c4e
6.124.166.12.11025e2505866c5
6.184.166.18.51af81f35e4f42
6.64.166.6.1577512838a19af
7.24.167.2.509453b467990
mainline4.167.35d1b3dea5a44
cip/5.104.165.10.271-cip789e4693436c7d
cip/6.14.166.1.189-cip618a02ee6c1c4e
cip/6.1-rt4.166.1.189-cip61-rt328a02ee6c1c4e
cip/6.124.166.12.111-cip3225e2505866c5

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.268-cip77-rt34)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)