Bug #3208
closedmoving zpool cross-endian results in incorrect user/group accounting
100%
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.
Updated by Christopher Siden about 11 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
changeset: 13835:eea81edc4f14
tag: tip
user: Matthew Ahrens <mahrens@delphix.com>
date: Mon Sep 24 06:37:22 2012 -0700
description:
3208 moving zpool cross-endian results in incorrect user/group accounting
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Christopher Siden <chris.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
modified:
usr/src/uts/common/fs/zfs/sys/sa_impl.h
usr/src/uts/common/fs/zfs/zfs_vfsops.c