ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ be346c1a6eeb49d8fda827d2a9522124c2f72f36 · < bd73971fad89d5ee4ea0ba9b92d2ea08733c4a64| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix NULL h_transaction deref in ocfs2_assure_trans_credits
[BUG] A direct write over unwritten extents can panic the kernel in ocfs2_assure_trans_credits() when the journal aborts during DIO completion. The crash is a general protection fault from a NULL pointer dereference.
[CAUSE] ocfs2_dio_end_io_write() loops over a direct write's unwritten extents, marking each written under a single journal handle. If the journal aborts (for example after an I/O error) while the extent tree is being updated, the handle is left aborted with its transaction pointer cleared. The extent merge treats that failure as not critical and reports success, so the loop keeps using the handle. ocfs2_assure_trans_credits() reads the handle's remaining credits without first checking whether the handle is aborted, and that read dereferences the cleared transaction pointer.
[FIX] A journal abort is recorded in the handle itself, so callers are expected to test the handle rather than rely on a returned error. Make ocfs2_assure_trans_credits() do that, as the other ocfs2 journal helpers already do, and return -EROFS when the handle is aborted.
From the CVE record · Linux
The Linux kernel's ocfs2 code can dereference a NULL transaction pointer during completion of a direct write over unwritten extents. If the journal aborts while the extent tree is being updated, the write can panic the kernel; the input does not specify authentication requirements or a network attack path.
Engineers running Linux kernels with ocfs2 should check their versions against the vendor advisory; affected versions are not specified.