CVE-2026-99476: fsverity: Set S_VERITY only after rollback is no longer possible
In the Linux kernel, the following vulnerability has been resolved:
fsverity: Set SVERITY only after rollback is no longer possible
Commit f77f281b6118 ("fsverity: use a hashtable to find the fsverityinfo") changed the implementation of FSIOCENABLEVERITY to make concurrent reads start going through fsverity verification slightly earlier than they did before.
Instead of it happening when enableverity() calls fsveritysetinfo(), it now happens when ->endenableverity() sets SVERITY.
However, ext4 and btrfs can roll back verity after they set SVERITY, causing a use-after-free.
Fix that by making ext4 and btrfs set SVERITY only after rollback is no longer possible. On failure, don't roll back SVERITY, but do roll back the filesystem-specific verity flag.
Also update enableverity() to handle any future instances of this bug more safely by warning and not freeing the fsverityinfo.
Finally, tweak some comments. Clarify one, and move information from another to its proper place in the comment for ->endenableverity().