lkml.org 
[lkml]   [2022]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 2/4] ipc: Use proper ipc namespace
Alexey Gladkov <legion@kernel.org> writes:

> As Eric Biederman pointed out, changing the namespace broke checkpoint
> restore. I have reverted my previous changes.

Can you remind me the bug that is being fixed here?

I am probably just going to fast to see it, but it would be good to have
it described in the commit comment.

Thanks,
Eric

>
> 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;

\
 
 \ /
  Last update: 2022-05-02 18:10    [W:0.181 / U:2.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site