ovl: keep err zero after successful ovl_cache_get()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ovl: keep err zero after successful ovl_cache_get()
ovl_iterate_merged() stores PTR_ERR(cache) in err before checking IS_ERR(cache). On success err holds the truncated cache pointer and can be returned as a bogus non-zero error.
The syzbot reproducer reaches this through overlay-on-overlay readdir:
getdents64 iterate_dir(outer overlay file) ovl_iterate_merged() ovl_cache_get() ovl_dir_read_merged() ovl_dir_read() iterate_dir(inner overlay file) ovl_iterate_merged()
Only compute PTR_ERR(cache) on the error path.
From the CVE record · Linux
In the Linux kernel, overlayfs can return a bogus non-zero error after a successful cache lookup. This can occur during overlay-on-overlay directory reads through getdents64. The input does not establish authentication requirements or a broader security impact.
Engineers running the Linux kernel with overlayfs, particularly overlay-on-overlay mounts, should check their kernel versions against the vendor advisory.