Re: [PATCH] mm: overcommit updates

From: Nikita Danilov
Date: Tue Jan 04 2005 - 07:37:37 EST


Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx> writes:

> ChangeSet 1.2136.3.17, 2005/01/03 20:15:37-08:00, Andries.Brouwer@xxxxxx
>

[...]

>
> + /* Leave the last 3% for root */
> + if (current->euid)
> + allowed -= allowed / 32;

This results in

/*
* Leave the last 3% for root
*/
if (!capable(CAP_SYS_ADMIN))
allowed -= allowed / 32;
allowed += total_swap_pages;

/* Leave the last 3% for root */
if (current->euid)
allowed -= allowed / 32;

in security/commoncaps.c (and similarly in security/dummy.c). Why
"super-user" reservation is handled twice, and with that antiquated
current->euid check instead of capabilities? Broken merge?

On another account, shouldn't capable(CAP_SYS_ADMIN) checks in
cap_vm_enough_memory() be replaced with capable(CAP_SYS_RESOURCE):
(CAP_SYS_RESOURCE is used by file systems to control reserved disk
blocks)?

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/