| Summary: | /usr/bin/quota incorrectly calculates NFS quota values. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Stephen Usher <stephen.usher> | ||||||
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
| Status: | Closed DUPLICATE | ||||||||
| Severity: | Affects Many People | CC: | cem | ||||||
| Priority: | --- | Keywords: | patch | ||||||
| Version: | 11.1-STABLE | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Attachments: |
|
||||||||
Created attachment 185645 [details]
Better and safer patch
Here's a better (and far safer) patch which works if the reported bsize is either smaller or larger than DEV_BSIZE.
The original bug caused the calculation of the scaling factor to underflow to zero is the reported bsize was smaller than DEV_BSIZE.
Obviated by r332632 / PR 227496. The patch in comment #1 is incorrect for quota64. The 32-bit return value truncates a 64-bit result. *** This bug has been marked as a duplicate of bug 227496 *** |
Created attachment 185644 [details] Patch to correct quota.c NFS calculation. quota(1) incorrectly reports zero values to NFS quotas due to incorrect arithmetic causing underflow to zero of unsigned integer values.