Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp764709pxb; Fri, 22 Apr 2022 10:39:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmUycLXqFQHGMjvjdlk+oE/3ZcQ2W7PKJFpsffH+irJ5pGUdZw+CciwX58U9RRfuJy51BR X-Received: by 2002:a17:90a:e604:b0:1d3:7887:3508 with SMTP id j4-20020a17090ae60400b001d378873508mr16635768pjy.224.1650649169785; Fri, 22 Apr 2022 10:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650649169; cv=none; d=google.com; s=arc-20160816; b=GkL1ZfFxGb9RbxIVPvaLSfpfkKNdqzGd8CZZtHQpo+3QvCqjl9LpU3FlnsB4ktbROI UKRpdTRxxQZbVEha40IEyWac+KoTH9GGx473t2vU3HFGd24l5fF5l9P6/MbPGoKAMOhl vVIaQz05f6rAIREjtahefxHQd2frl4V6eBZwDHgGLhTReHFrT/6yKOF5AVxmWj3eRzQZ Bu6R19DpRfplVzI9fH3SGXTwR/fUFIxJDNSFPYDEdloM8MoD9vWx+XQ2Xj+sbCWXeqfM rUSkZOWj5onPV/lrBkqd7nnjoyMswBvXVZ2UJWHrg3+onhfmdO++0gEz9HGqpwCM6r7S 1jmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iP13K6hBFSw+NWO+xxYKXdgobu9N0MhujCliRkR1SDw=; b=Zr1uI0p0pE9Wi7t15OiZBZD/+kJefrwHCg2a6n1BRxW1c7GBV5L9pICyEvklrbbCNa PM0yUVeQvSJMlrA2A/ufQNFiJjFoVIvZI8ASRkjokRONz+aQx4bo6RNMbmq68k21aRvn PRtO5XnWEYMFQDF9dL3luYtzf1S2Zz5Dp8PvSX0hZ17ACSev45UxBS6R/X1EIelaYlXV u3qz+dIVcq/3NqQq1vjJbxUsqVcPhnXRzseLFfr/FdAj3z0LE9oaPz72bdT+MTCYCUps /XsFM4M3Y8ZnKvdvL6peNVojfxebSM1qZlSTQuxY/4tuLCMqB8SYdQkq0zl4nS7chx5T rHaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v186-20020a6389c3000000b003aaeebdcd0bsi66422pgd.388.2022.04.22.10.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:39:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E859AC6F01; Fri, 22 Apr 2022 10:28:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233859AbiDVM6B (ORCPT + 99 others); Fri, 22 Apr 2022 08:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447670AbiDVM4w (ORCPT ); Fri, 22 Apr 2022 08:56:52 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 391E1527F5 for ; Fri, 22 Apr 2022 05:53:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-628-AnjXehsdPmmzQ8-DhAtM3A-1; Fri, 22 Apr 2022 08:53:54 -0400 X-MC-Unique: AnjXehsdPmmzQ8-DhAtM3A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14DCF38337EE; Fri, 22 Apr 2022 12:53:54 +0000 (UTC) Received: from comp-core-i7-2640m-0182e6.redhat.com (unknown [10.36.110.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B64BC28107; Fri, 22 Apr 2022 12:53:51 +0000 (UTC) From: Alexey Gladkov To: LKML , "Eric W . Biederman" , Linus Torvalds Cc: Alexander Mikhalitsyn , Andrew Morton , Christian Brauner , Daniel Walsh , Davidlohr Bueso , Kirill Tkhai , Linux Containers , Manfred Spraul , Serge Hallyn , Varad Gautam , Vasily Averin Subject: [PATCH v1 2/4] ipc: Use proper ipc namespace Date: Fri, 22 Apr 2022 14:53:38 +0200 Message-Id: <32a29b3eb5f560e30ef24cfb86e480684b49ac62.1650631347.git.legion@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As Eric Biederman pointed out, changing the namespace broke checkpoint restore. I have reverted my previous changes. 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; -- 2.33.2