Bug 73244 - quota doesn't support large user id numbers
Summary: quota doesn't support large user id numbers
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: quota   
(Show other bugs)
Version: 7.3
Hardware: i686 Linux
Target Milestone: ---
Assignee: Phil Copeland
QA Contact: Brock Organ
Keywords: Security
: 69936 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2002-09-01 17:26 UTC by Petri T. Koistinen
Modified: 2007-03-27 03:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-03 07:56:40 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
The structure state when it all goes horribly wrong,... (13.01 KB, image/png)
2002-09-03 00:58 UTC, Phil Copeland
no flags Details

Description Petri T. Koistinen 2002-09-01 17:26:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.18-12.5 i686; Nav)

Description of problem:
We have system where username and userid number are same. Usernames
are formed using this pattern:


Where YY is last two numbers of year and NNNNN is running number.
If fact this is student number. For example my number is student number is
9700265. So my user-id is quite large, it is 9700265.

Then I try to set quota for my account:

# /usr/sbin/edquota -p quotaproto-op 9700265
edquota: Error while getting quota from /dev/cciss/c0d1p2 for 9700265: Invalid
edquota: Error while getting quota from /dev/cciss/c0d0p6 for 9700265: Invalid

Quota won't work for me, or anybody else with 9XNNNNN type user-id/name.
On the other hand if I we have useid which starts with 00NNNNN, 01NNNNN or
02NNNNN they will work because their UID's are much smaller.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Try setting quota with BIG userid's.

Actual Results:  Quota doesn't work for "old" people. ;)
To be serious: some people are able to fill whole filesystem.
(/var and /home).

Additional info:


Comment 1 Petri T. Koistinen 2002-09-01 17:28:55 UTC
Oh, too much spelling errors...sorry. I hope you get the idea.

Comment 2 Phil Copeland 2002-09-02 18:02:59 UTC
I have an errata queued up for this already, as and when QA get to it, it'll be

[copeland@porkchop copeland]$ latest-pkg dist-7.3-errata-candidate quota

NOTE: the source rpm
currently in rawhide for 8.0 is the same code for 7.3-errata-candidate. you can
download this and issue 'rpmbuild --rebuild quota-3.06-4.src.rpm' and install
the resulting rpms to fix this issue


Comment 3 Petri T. Koistinen 2002-09-02 19:14:08 UTC
I downloaded the source package, builded it as instructed and installed it with
command 'rpm -Uvh /usr/src/redhat/RPMS/i386/quota-3.06-4.i386.rpm'.

To make sure there is no old quota around I also rebooted the machine.
This patch does _not_ work for us. We are getting similar errors as before.
Like this:

[root@telinux1 pkoistin]# quota -v 9700265
quota: Error while getting quota from /dev/cciss/c0d1p2 for 9700265: Invalid
quota: Error while getting quota from /dev/cciss/c0d0p6 for 9700265: Invalid
quota: Error while getting quota from for
9700265: Connection refused
quota: Error while getting quota from for 9700265: Connection refused
Disk quotas for user #9700265 (uid 9700265): none
[root@telinux1 pkoistin]# 

Last two errors should not have any revelance to this bug.

Comment 4 Phil Copeland 2002-09-03 00:57:51 UTC
Ok,.. lets have a look at this again

[root@bryce2 SPECS]# rpm -Uvh /usr/src/redhat/RPMS/i386/quota-3.06-4.i386.rpm

Ok lets create a partition with quota enabled
/dev/hdb9              2743460   2252040    352060  87% /compile
[root@bryce2 /]# quotacheck -c /dev/hdb9
[root@bryce2 /]# mount
/dev/hdb9 on /compile type ext3 (rw,quota)

ok lets create a user
[root@alpha root]# useradd qwerty -u 9700265 -d /compile/qwerty
Ok and a test one
[root@bryce2 /]# useradd test -u 9700 -d /compile/qwerty

add some quotas,...

lets see how we do

[root@bryce2 /]# quota test  
Disk quotas for user test (uid 9700): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/hdb9       8    1000    2000               2       0       0        
[root@bryce2 /]# quota qwerty
quota: Error while getting quota from /dev/hdb9 for 9700265: Invalid argument
Disk quotas for user qwerty (uid 9700265): none

An strace shows up

geteuid32()                             = 0
quotactl(0xd00 /* Q_??? */|USRQUOTA, "/dev/hdb9", 9700, {0, 0, 2, 2000, 1000,
8192, 0, 0}) = 0

geteuid32()                             = 0
quotactl(0xd00 /* Q_??? */|USRQUOTA, "/dev/hdb9", 9700265, {0, 0, 0, 0, 0,
1073813768, 70, 1073814272}) = -1 EINVAL (Invalid argument)

Humm looks like a kernel fault not the userland
(tracked to quotaio_v2.c:645 where this code is executed
if (quotactl(QCMD(Q_V2_GETQUOTA, h->qh_type), h->qh_quotadev, id, (void
*)&kdqblk) < 0) {

This call fails. (structure snapshot in next attachment)

include/linux/quota.h:long quotactl __P ((int, const char *, qid_t,

Comment 5 Phil Copeland 2002-09-03 00:58:41 UTC
Created attachment 74568 [details]
The structure state when it all goes horribly wrong,...

Comment 6 Phil Copeland 2002-09-03 01:31:06 UTC
Structure is properly formed...
Ah,.. there we go,...

linux/fs/dquot.c +2060

        if (id & ~0xFFFF)
                goto out;

someone didn't notice that uid_t is (2^32)-1 not (2^16)-1
Should be if (id & ~0xFFFFFFFF)
actually, that check could be pulled out altogether I think (looking at

Kernel bug


Comment 7 Phil Copeland 2002-09-03 15:32:04 UTC
*** Bug 69936 has been marked as a duplicate of this bug. ***

Comment 8 Petri T. Koistinen 2002-09-04 07:30:31 UTC
Offtopic comment: which is the name of the debugger that this screengrab is taken from? It looks nice. ;)

Comment 9 Andrew Sydelko 2002-09-04 14:57:10 UTC
Ok, the kernel fix makes edquota work, but after running checkquota on the
filesystem, the highuid user still has their information show up for 
(their uid - 65536) as reported by repquota.

Comment 10 Andrew Sydelko 2002-09-04 15:45:43 UTC
recompiling the quota rpm using '--with-ext2direct=no' fixes the other quota
utils to work properly...

Comment 11 Petri T. Koistinen 2002-09-05 11:02:57 UTC
Could you give me the new kernel for testdrive before releasing the errata?

Comment 12 Phil Copeland 2002-09-06 15:05:01 UTC
Thoron, the struct snapshot was from using 'ddd' and cut out using 'xv's screen
grab feature.

Current kernel >= 2.4.18-14 has the quota fix in. You should be able to find it
in rawhide

I don't believe this will be fixed for the release as various deadlines have
elapsed though 8/ possibly an errata item after the fact I fear


Comment 13 Petri T. Koistinen 2002-09-06 15:43:33 UTC
Let me make myself clear: are you saying that you are not going to release
Red Hat 7.3 security advisory about this? If this is missing from Red Hat 8.0 or
whatever you are talking about, it doesn't matter to me now. (Althought it would
be nice.)

Thank you very much for the patch, I will install the new kernel (from Raw Hide)
and report if it works with 7.3 system.

Comment 14 Phil Copeland 2002-09-06 15:55:23 UTC
I was refering to the 'about to go out the door and onto store shelves' release.
All resources here are currently focused on makeing that product happen to a
deadline. As soon as thats out of the way then we'll go firefighting the
6.2->7.3 issues.

Even if I built the quota errata right now (actually, I have), it has to go
through QA first and they're backlogged with other work. You won't see it for
some time.


Comment 15 Petri T. Koistinen 2002-09-06 16:02:58 UTC
Thank you very much about the clarification. I hope use of Raw Hide kernel don't
cause me any problems, well I can always go back to kernel which works for me,
but does not have proper quota support. I am looking forward to see that new
kernel appear in public Raw Hide archive soon.

Comment 16 Petri T. Koistinen 2002-09-15 21:40:06 UTC
Hi! I see no new kernel in Raw Hide. I would realy like to beta test this kernel
before you release the official errata, just to make sure it works. Could you
deliver me the new kernel off the record? (Well, this is that record, but
anyway. Can you be flexible with this issue, or is it forbidden by management?)

Comment 17 Phil Copeland 2002-09-16 18:44:07 UTC
Humm I thought it was already in rawhide, but apparently not. It is available
through the beta test program though.


Comment 18 Petri T. Koistinen 2002-09-16 20:57:45 UTC
Stupid question: What is beta test program and how can I join to it?

Comment 19 Petri T. Koistinen 2002-10-03 07:56:34 UTC
I am willing to test 7.3 errata kernel before it's officially released, so that 
we can be sure it works.

Comment 20 Petri T. Koistinen 2002-10-21 20:09:50 UTC
Problem is fixed with

Thank you!

Note You need to log in before you can comment on or make changes to this bug.