[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8edba64-9b4b-1ef8-f0b3-1b4beacf1551@colorfullife.com>
Date: Tue, 4 Jan 2022 19:13:40 +0100
From: Manfred Spraul <manfred@...orfullife.com>
To: Alexey Gladkov <legion@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux Containers <containers@...ts.linux.dev>
Cc: Alexander Mikhalitsyn <alexander.mikhalitsyn@...tuozzo.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christian Brauner <christian.brauner@...ntu.com>,
Daniel Walsh <dwalsh@...hat.com>,
Davidlohr Bueso <dbueso@...e.de>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Serge Hallyn <serge@...lyn.com>,
Varad Gautam <varad.gautam@...e.com>,
Vasily Averin <vvs@...tuozzo.com>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] ipc: Store mqueue sysctls in the ipc namespace
Hi Alexey,
On 1/4/22 12:51, Alexey Gladkov wrote:
> Right now, the mqueue sysctls take ipc namespaces into account in a
> rather hacky way. This works in most cases, but does not respect the
> user namespace.
>
> Within the user namespace, the user cannot change the /proc/sys/fs/mqueue/*
> parametres. This poses a problem in the rootless containers.
>
> To solve this I changed the implementation of the mqueue sysctls just
> like some other sysctls.
>
> Before this change:
>
> $ echo 5 | unshare -r -U -i tee /proc/sys/fs/mqueue/msg_max
> tee: /proc/sys/fs/mqueue/msg_max: Permission denied
> 5
Could you crosscheck that all (relevant) allocations in ipc/mqueue.c use
GFP_KERNEL_ACCOUNT?
We should not allow normal users to use up all memory.
Otherwise:
The idea is good, the limits do not really prevent using up all memory,
_ACCOUNT is the better approach.
And with _ACCOUNT, it doesn't hurt that the namespace root is able to
set limits.
--
Manfred
Powered by blists - more mailing lists