Project

General

Profile

Bug #3208

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

Added by Christopher Siden almost 7 years ago. Updated almost 7 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

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.

History

#1

Updated by Christopher Siden almost 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

changeset: 13835:eea81edc4f14
tag: tip
user: Matthew Ahrens <>
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 <>
Reviewed by: Christopher Siden <>
Approved by: Richard Lowe <>

modified:
usr/src/uts/common/fs/zfs/sys/sa_impl.h
usr/src/uts/common/fs/zfs/zfs_vfsops.c

Also available in: Atom PDF