lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/4] ipc: Use proper ipc namespace
Date
As Eric Biederman pointed out, changing the namespace broke checkpoint
restore. I have reverted my previous changes.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
ipc/ipc_sysctl.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index eb7ba8e0a355..ff99d0305a5b 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -72,7 +72,7 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,
static int proc_ipc_dointvec_minmax_checkpoint_restore(struct ctl_table *table,
int write, void *buffer, size_t *lenp, loff_t *ppos)
{
- struct ipc_namespace *ns = table->extra1;
+ struct ipc_namespace *ns = current->nsproxy->ipc_ns;
struct ctl_table ipc_table;

if (write && !checkpoint_restore_ns_capable(ns->user_ns))
@@ -244,15 +244,12 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns)
#ifdef CONFIG_CHECKPOINT_RESTORE
} else if (tbl[i].data == &init_ipc_ns.ids[IPC_SEM_IDS].next_id) {
tbl[i].data = &ns->ids[IPC_SEM_IDS].next_id;
- tbl[i].extra1 = ns;

} else if (tbl[i].data == &init_ipc_ns.ids[IPC_MSG_IDS].next_id) {
tbl[i].data = &ns->ids[IPC_MSG_IDS].next_id;
- tbl[i].extra1 = ns;

} else if (tbl[i].data == &init_ipc_ns.ids[IPC_SHM_IDS].next_id) {
tbl[i].data = &ns->ids[IPC_SHM_IDS].next_id;
- tbl[i].extra1 = ns;
#endif
} else {
tbl[i].data = NULL;
--
2.33.2
\
 
 \ /
  Last update: 2022-04-22 14:57    [W:0.194 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site