hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 55d1cbbbb29e6656c662ee8f73ba1fc4777532eb · < 90e019006644dad35862cb4aa270f561b0732066| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
Commit 55d1cbbbb29e ("hfs/hfsplus: use WARN_ON for sanity check") fixed a build warning by turning a comment into a WARN_ON(), but it turns out that syzbot then complains because it can trigger said warning with a corrupted hfs image.
The warning actually does warn about a bad situation, but we are much better off just handling it as the error it is. So rather than warn about us doing bad things, stop doing the bad things and return -EIO.
While at it, also fix a memory leak that was introduced by an earlier fix for a similar syzbot warning situation, and add a check for one case that historically wasn't handled at all (ie neither comment nor subsequent WARN_ON).
From the CVE record · Linux
The Linux kernel’s hfs/hfsplus handling can trigger a kernel warning when it processes a corrupted HFS image. The input does not establish whether an attacker needs local access, authentication, or user interaction to trigger it. The fix handles the condition as an error and also addresses a memory leak.
Engineers running Linux kernels with hfs/hfsplus support should check whether their kernel is affected; no affected versions are specified.