From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3DD3C433F5 for ; Mon, 2 May 2022 16:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241505AbiEBQNC (ORCPT ); Mon, 2 May 2022 12:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241181AbiEBQNA (ORCPT ); Mon, 2 May 2022 12:13:00 -0400 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFDFDF52 for ; Mon, 2 May 2022 09:09:31 -0700 (PDT) Received: from in02.mta.xmission.com ([166.70.13.52]:35878) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nlYc6-00D9TG-5q; Mon, 02 May 2022 10:09:30 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:36680 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nlYc5-0030RY-2P; Mon, 02 May 2022 10:09:29 -0600 From: "Eric W. Biederman" To: Alexey Gladkov Cc: LKML , Linus Torvalds , Alexander Mikhalitsyn , Andrew Morton , Christian Brauner , Daniel Walsh , Davidlohr Bueso , Kirill Tkhai , Linux Containers , Manfred Spraul , Serge Hallyn , Varad Gautam , Vasily Averin References: <32a29b3eb5f560e30ef24cfb86e480684b49ac62.1650631347.git.legion@kernel.org> Date: Mon, 02 May 2022 11:09:22 -0500 In-Reply-To: <32a29b3eb5f560e30ef24cfb86e480684b49ac62.1650631347.git.legion@kernel.org> (Alexey Gladkov's message of "Fri, 22 Apr 2022 14:53:38 +0200") Message-ID: <87sfprudal.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nlYc5-0030RY-2P;;;mid=<87sfprudal.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX19y/q/FQzGs6F1Akdf/n30W2F0lmB7XTpg= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH v1 2/4] ipc: Use proper ipc namespace X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexey Gladkov 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 > Signed-off-by: Alexey Gladkov > --- > 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;