In the Linux kernel, the following vulnerability has been resolved: ptp: unwind partially completed virtual clock creation n_vclocks_store() publishes the new clock count only after every child has been registered. If a later registration fails, it returns without unregistering the children already created by that request. Those clocks are left out of n_vclocks, and a subsequent request can overwrite their index entries without removing them. Unregister the newly created children in reverse order and clear their index entries on failure. Leave the previously installed clocks and their count unchanged. The n_vclocks mutex serializes this rollback with other sysfs changes, and parent removal drains the store before walking the children. This was found by code inspection while adding initial PHC sample error handling to virtual clock registration.
https://git.kernel.org/stable/c/f09f86c83d1d2678dd143b42c7119297eaf0eb0f
https://git.kernel.org/stable/c/adf81653ab2407769c49490c58d9ebec84e4a279
https://git.kernel.org/stable/c/3dea778260e3dddf30651a6913d87a42861346a2
https://git.kernel.org/stable/c/1e8b0d578dacb89064394b842894580d6eff470a
https://git.kernel.org/stable/c/0c465f41ccb158e7afe52df37256488071b997cb