{"id":24689,"date":"2026-09-16T20:32:39","date_gmt":"2026-09-16T12:32:39","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-90001"},"modified":"2026-09-16T20:32:39","modified_gmt":"2026-09-16T12:32:39","slug":"cve-2026-90001","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-90001","title":{"rendered":"CVE-2026-90001 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\nHID: bpf: serialize d"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>HID: bpf: serialize device reference release in struct_ops destroy path<\/p>\n<p>__hid_bpf_ops_destroy_device() and hid_bpf_unreg() can race on the<br \/>\nsame registration reference, double-putting struct hid_device and<br \/>\nfreeing it while hid_destroy_device() still uses it.  Serialize the<br \/>\nremove\/NULL decision under hdev-&gt;bpf.prog_list_lock so exactly one<br \/>\npath releases each registration reference: unreg re-checks ops-&gt;hdev<br \/>\nunder the lock and returns without putting when the destroy path<br \/>\nalready cleared it; all put_device() calls happen after the lock is<br \/>\ndropped, which is safe because a concurrent unreg then observes<br \/>\nops-&gt;hdev == NULL under the lock.<\/p>\n<p>Background: each successful attach (hid_bpf_ops_reg) acquires one<br \/>\ndevice reference (hid_get_device()).  Two paths can release it:<\/p>\n<p>&#8211; device destruction: hid_destroy_device() -&gt; hid_bpf_destroy_device()<br \/>\n  -&gt; __hid_bpf_ops_destroy_device(), which walks hdev-&gt;bpf.prog_list<br \/>\n  under rcu_read_lock() and drops one reference per attached program;<br \/>\n&#8211; BPF link release: bpf map delete (no BPF_F_LINK) synchronously calls<br \/>\n  st_ops-&gt;unreg() -&gt; hid_bpf_unreg(), which drops the reference for<br \/>\n  its own registration.<\/p>\n<p>The coordination handshake (e-&gt;hdev = NULL on the destroy side vs<br \/>\n&#8220;if (!hdev) return&#8221; on the unreg side) is a TOCTOU check: the two<br \/>\npaths run under different lock domains (rcu_read_lock vs<br \/>\nprog_list_lock), so a concurrent unreg can read ops-&gt;hdev as<br \/>\nnon-NULL, block on prog_list_lock, and then proceed while the<br \/>\ndestroy traversal executes &#8211; both paths then drop the same<br \/>\nreference.  The refcount reaches zero legitimately (each decrement<br \/>\nis individually valid), so no refcount_t saturation fires: the<br \/>\ndevice is simply freed while the transport is still inside<br \/>\nhid_destroy_device(), and subsequent teardown touches freed memory.<\/p>\n<p>The fix serializes the remove\/NULL decision under prog_list_lock on<br \/>\nboth sides and moves the destroy-side puts outside the lock.  With<br \/>\nthe lock held, plain reads\/writes of ops-&gt;hdev are sufficient; no<br \/>\nREAD_ONCE\/WRITE_ONCE are added, keeping the patch minimal.<\/p>\n<p>Unlocked-read safety: the unlocked read of ops-&gt;hdev at the top of<br \/>\nhid_bpf_unreg() cannot touch a freed device, because the unreg path<br \/>\nitself still holds this registration&#8217;s reference (released only by<br \/>\nits own hid_put_device() after the lock is dropped), and a destroy<br \/>\ntraversal that already cleared ops-&gt;hdev makes the lock-internal<br \/>\nre-check return early without any put.  At most one of the two<br \/>\npaths releases each registration reference.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>HID: bpf: serialize device reference release in struct_ops destroy path<\/p>\n<p>__hid_bpf_ops_destroy_device() and hid_bpf_unreg() can rac<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-24689","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/24689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}