By Jonathan Corbet
November 9, 2011
The second version of the
plumber's
wish list for Linux included a request for support for usage quotas on
the tmpfs filesystem. Current kernels have no such support, making it easy
for local users to execute denial-of-service attacks by filling up
/tmp or
/dev/shm. Davidlohr Bueso answered that call
with
a patch providing that support. But
it turns out that there is a disagreement over how tmpfs use limits should be
managed.
Davidlohr's patch does not actually implement quotas; instead, it adds a
new resource limit (RLIMIT_TMPFSQUOTA) controlling how much space
a user can occupy on all
mounted tmpfs systems. This is the approach requested in the wish list; it
has some appeal because tmpfs is not a persistent filesystem. Normal
filesystem implementations store quotas on the filesystem itself, but tmpfs
cannot do that. So use of quotas would require that user space, in some
fashion, reload the quota database on every boot (or, depending on the
implementation, for every tmpfs mount). Resource limits look like a
simpler situation.
Even so, there is opposition to the resource limit approach. Developers
would rather see tmpfs behave like other filesystems. More to the point,
perhaps, users and applications have some clue, some of the time, on how to
respond to "quota exceeded" errors. Blown resource limits, instead, are
on less solid ground. As Alan Cox pointed
out, loading the quotas need not be a big problem; it could be as
simple as a mount option setting a default quota for all users.
In the end, it seems unlikely that an implementation based on anything
other than disk quotas will be merged, so this patch will need to be
reworked.
(
Log in to post comments)