moving zpool cross-endian results in incorrect user/group accounting
From Matt Ahrens's original bug report at Delphix:
When a zpool is moved to a different-endian machine (i.e. between SPARC and x86), we byteswap the data as we read it in. However, the SA (system attributes) data is stored as a byte array and is swapped by the SA code. This is fine, but the SA code in zfs_space_delta_cb() fails to swap the bytes.
It happens that the mis-calculated sa_hdrsize() is usually 0, which is handled specially and we end up charging uid=0,gid=0 (root/root). This can result in root's accounting going negative, which there is no guard against.
If the hdrsize happened to be mis-calculated differently, we would really go to crazy town and start subtracting from non-existant users' accounts.
Updated by Christopher Siden almost 9 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
user: Matthew Ahrens <email@example.com>
date: Mon Sep 24 06:37:22 2012 -0700
3208 moving zpool cross-endian results in incorrect user/group accounting
Reviewed by: Adam Leventhal <firstname.lastname@example.org>
Reviewed by: Christopher Siden <email@example.com>
Approved by: Richard Lowe <firstname.lastname@example.org>