Bug 878859

Summary: [xfs/projid32bit] Setting projid32bit that is higher than 32-bit succeeds
Product: Red Hat Enterprise Linux 6 Reporter: Boris Ranto <branto>
Component: xfsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Filesystem QE <fs-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: bfoster, cmaiolin, dchinner, ddumas, esandeen, kzhang, lczerner, rwheeler, tlavigne, zab
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: xfsprogs-3.1.1-10.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 11:00:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 886216    

Description Boris Ranto 2012-11-21 12:26:29 UTC
Description of problem:
xfs_quota allows higher than 32-bit projid to be set simply by overflowing the integer.

Version-Release number of selected component (if applicable):
xfsprogs-3.1.1-9.el6

How reproducible:
Always

Steps to Reproduce:
1. Create and mount projid32bit enabled fs
mkfs.xfs -i projid32bit=1 /dev/sda2
mount -o pquota /dev/sda2 /media
2. Try setting higher than 32-bit projid with xfs_quota
xfs_quota -x -c 'project -s -p /media/file 5123456789' /dev/sda2
3. Check the projid
xfs_io -r -c lsproj /media/file
  
Actual results:
The xfs_quota command succeeds and xfs_io reports projid to be 828489493 = 5123456789 - 2**32.

Expected results:
The xfs_quota fails to set the higher than 32-bit projid.

Additional info:
This is easily reproducible with xfstests test case no. 244 (the last test fails).

Comment 2 Dave Chinner 2012-11-23 01:13:59 UTC
This isn't a kernel problem - the ioctl can only pass a 32 bit value. The bug will be in the userspace xfs_quota command, and it looks like it was fixed quite some time ago upstream by commit 272f4db5 ("xfsprogs: validate string -> number conversion").

-Dave.

Comment 5 Eric Sandeen 2012-11-28 22:34:26 UTC
Ok, the commit dave points at is easily applied & tested, I'm happy to respin it if we do get a blocker approved.

Comment 6 Eric Sandeen 2012-11-30 22:12:35 UTC
xfsprogs-3.1.1-10.el6 building now w/ this fix.

Comment 10 errata-xmlrpc 2013-02-21 11:00:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0481.html