OSDN Git Service

ipc: Store mqueue sysctls in the ipc namespace
authorAlexey Gladkov <legion@kernel.org>
Mon, 14 Feb 2022 18:18:14 +0000 (19:18 +0100)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 19:39:40 +0000 (13:39 -0600)
commitdc55e35f9e810f23dd69cfdc91a3d636023f57a2
tree66088dcec1207970b3dd880251eb334c3e7fca35
parentffb217a13a2eaf6d5bd974fc83036a53ca69f1e2
ipc: Store mqueue sysctls in the ipc namespace

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.

So far, the changes do not provide additional access to files. This will
be done in a future patch.

v3:
* Don't implemenet set_permissions to keep the current behavior.

v2:
* Fixed compilation problem if CONFIG_POSIX_MQUEUE_SYSCTL is not
  specified.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
Link: https://lkml.kernel.org/r/b0ccbb2489119f1f20c737cf1930c3a9c4e4243a.1644862280.git.legion@kernel.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
include/linux/ipc_namespace.h
ipc/mq_sysctl.c
ipc/mqueue.c
ipc/namespace.c