Skip to content

Conversation

@tlnguyen-smu
Copy link

The quota assign ioctl can currently run in parallel with a quota disable ioctl call. The assign ioctl uses the quota root, while the disable ioctl frees that root, and therefore we can have a use-after-free triggered in the assign ioctl.

This PR fixes a potential security vulnerability in btrfs_ioctl_qgroup_assign(), btrfs_qgroup_account_extents() that were cloned from https://github.com/torvalds/linux but did not receive the security patch.

Fix this by having the qgroup assign ioctl take the qgroup ioctl mutex before calling btrfs_run_qgroups(), which is what all qgroup ioctls should call.

Details:

Affected Function: btrfs_ioctl_qgroup_assign(), btrfs_qgroup_account_extents()
Original Fix: torvalds/linux@2f1a6be

What this PR does:

This PR applies the same security patch that was applied to the original repository to eliminate the potential vulnerability in the cloned code.

References:

Please review and merge this PR to ensure your repository is protected against this potential vulnerability.

The quota assign ioctl can currently run in parallel with a quota disable ioctl call. The assign ioctl uses the quota root, while the disable ioctl frees that root, and therefore we can have a use-after-free triggered in the assign ioctl.

Fix this by having the qgroup assign ioctl take the qgroup ioctl mutex before calling btrfs_run_qgroups(), which is what all qgroup ioctls should call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants