Fix zfs_get_data access to files with wrong generation causing panics
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zfs-linux (Ubuntu) |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Focal |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Hirsute |
Fix Released
|
High
|
Dimitri John Ledkov | ||
Impish |
Fix Released
|
High
|
Dimitri John Ledkov |
Bug Description
== SRU Focal/Hirsute ==
[Impact]
ZFS: Fix a panic while acquiring a lock.
If TX_WRITE is create on a file, and the file is later deleted and a new
directory is created on the same object id, it is possible that when
zil_commit happens, zfs_get_data will be called on the new directory.
This may result in panic as it tries to do range lock.
Upstream ZFS bug #10593, #11682, upstream fix:
commit 296a4a369bc1078
Author: Chunwei Chen <email address hidden>
Date: Fri Mar 19 22:53:31 2021 -0700
Fix zfs_get_data access to files with wrong generation
This patch fixes this issue by record the generation number during
zfs_log_write, so zfs_get_data can check if the object is valid.
The fix is already in Ubuntu ZFS 2.0.6 in Impish. The fix is a relatively simple backport with only minor backporting effort required in moving some of the module specific upstream changes into the pre-renamed module specific os specific parts of the ZFS module.
[Test Plan]
This is difficult to reproduce, see https:/
The fix has been tested with the complete ubuntu autotest ZFS regression tests that exercise ZFS core functionality (smoke tests), file system POSIX compliance (fs tests), extra XFS tests and every mount option with stress-ng file I/O stress tests.
[Where problems could occur]
This fix could regress the ZIL (ZFS intent log) commit writes since it modifies this code to now checks for generation numbers. Testing with ZFS autotests with intent logs have not found any regressions, but there is a risk that the ZIL functionality is affected. This could lead to corruption.
------
As mentioned at https:/
This fix does not appear to be a part of the latest Ubuntu 20.04 release:
zfsutils-linux:
Installed: 0.8.3-1ubuntu12.12
Candidate: 0.8.3-1ubuntu12.12
Version table:
*** 0.8.3-1ubuntu12.12 500
500 http://
100 /var/lib/
0.
500 http://
0.
500 http://
Of note is this issue where the bug is reported against the Ubuntu 0.8.3 packages: https:/
Changed in zfs-linux (Ubuntu Impish): | |
status: | Triaged → Fix Released |
Changed in zfs-linux (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in zfs-linux (Ubuntu Hirsute): | |
importance: | Undecided → High |
status: | New → In Progress |
Changed in zfs-linux (Ubuntu Focal): | |
status: | New → In Progress |
assignee: | nobody → Colin Ian King (colin-king) |
Changed in zfs-linux (Ubuntu Hirsute): | |
assignee: | nobody → Colin Ian King (colin-king) |
Changed in zfs-linux (Ubuntu Focal): | |
assignee: | Colin Ian King (colin-king) → nobody |
assignee: | nobody → Dimitri John Ledkov (xnox) |
Changed in zfs-linux (Ubuntu): | |
status: | In Progress → Fix Released |
Upstream commit:
commit 296a4a369bc1078 a694f8857097233 0985b3b1b8
Author: Chunwei Chen <email address hidden>
Date: Fri Mar 19 22:53:31 2021 -0700
Fix zfs_get_data access to files with wrong generation