Project

General

Profile

Actions

Bug #3208

closed

moving zpool cross-endian results in incorrect user/group accounting

Added by Christopher Siden about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Category:
zfs - Zettabyte File System
Start date:
2012-09-20
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

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.

Actions

Also available in: Atom PDF