quota: Fix potential NULL pointer dereference
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7b9ca4c61bc278b771fb57d6290a31ab1fc7fdac · < 40a673b4b07efd6f74ff3ab60f38b26aa91ee5d5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
quota: Fix potential NULL pointer dereference
Below race may cause NULL pointer dereference
P1 P2 dquot_free_inode quota_off drop_dquot_ref remove_dquot_ref dquots = i_dquot(inode) dquots = i_dquot(inode) srcu_read_lock dquots[cnt]) != NULL (1) dquots[type] = NULL (2) spin_lock(&dquots[cnt]->dq_dqb_lock) (3) ....
If dquot_free_inode(or other routines) checks inode's quota pointers (1) before quota_off sets it to NULL(2) and use it (3) after that, NULL pointer dereference will be triggered.
So let's fix it by using a temporary pointer to avoid this issue.
From the CVE record · Linux
A race between quota operations in the Linux kernel can cause a NULL pointer dereference. It can occur when one routine checks an inode’s quota pointer before another clears it, then uses the pointer afterward. The input does not specify whether an attacker can trigger the race or whether access or user interaction is required.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.