From nobody Wed May 13 18:35:51 2026 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 3A362C433EF for ; Fri, 22 Apr 2022 12:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233950AbiDVM5t (ORCPT ); Fri, 22 Apr 2022 08:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233803AbiDVM4v (ORCPT ); Fri, 22 Apr 2022 08:56:51 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D6C0527F5 for ; Fri, 22 Apr 2022 05:53:57 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-407-aAbXDRs3NLWNoZry2Z3Lxw-1; Fri, 22 Apr 2022 08:53:52 -0400 X-MC-Unique: aAbXDRs3NLWNoZry2Z3Lxw-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 36940101AA45; Fri, 22 Apr 2022 12:53:51 +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 A2EFEC28107; Fri, 22 Apr 2022 12:53:48 +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 1/4] ipc: Remove extra1 field abuse to pass ipc namespace Date: Fri, 22 Apr 2022 14:53:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Eric Biederman pointed out that using .extra1 to pass ipc namespace looks like an ugly hack and there is a better solution. Link: https://lore.kernel.org/lkml/87czib9g38.fsf@email.froward.int.ebieder= m.org/ Signed-off-by: Eric W. Biederman Signed-off-by: Alexey Gladkov --- ipc/ipc_sysctl.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 15210ac47e9e..eb7ba8e0a355 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -19,16 +19,11 @@ static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int w= rite, void *buffer, size_t *lenp, loff_t *ppos) { - struct ipc_namespace *ns =3D table->extra1; - struct ctl_table ipc_table; + struct ipc_namespace *ns =3D + container_of(table->data, struct ipc_namespace, shm_rmid_forced); int err; =20 - memcpy(&ipc_table, table, sizeof(ipc_table)); - - ipc_table.extra1 =3D SYSCTL_ZERO; - ipc_table.extra2 =3D SYSCTL_ONE; - - err =3D proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos); + err =3D proc_dointvec_minmax(table, write, buffer, lenp, ppos); =20 if (err < 0) return err; @@ -55,20 +50,15 @@ static int proc_ipc_auto_msgmni(struct ctl_table *table= , int write, static int proc_ipc_sem_dointvec(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { - struct ipc_namespace *ns =3D table->extra1; - struct ctl_table ipc_table; + struct ipc_namespace *ns =3D + container_of(table->data, struct ipc_namespace, sem_ctls); int ret, semmni; =20 - memcpy(&ipc_table, table, sizeof(ipc_table)); - - ipc_table.extra1 =3D NULL; - ipc_table.extra2 =3D NULL; - semmni =3D ns->sem_ctls[3]; ret =3D proc_dointvec(table, write, buffer, lenp, ppos); =20 if (!ret) - ret =3D sem_check_semmni(current->nsproxy->ipc_ns); + ret =3D sem_check_semmni(ns); =20 /* * Reset the semmni value if an error happens. @@ -131,6 +121,8 @@ static struct ctl_table ipc_sysctls[] =3D { .maxlen =3D sizeof(init_ipc_ns.shm_rmid_forced), .mode =3D 0644, .proc_handler =3D proc_ipc_dointvec_minmax_orphans, + .extra1 =3D SYSCTL_ZERO, + .extra2 =3D SYSCTL_ONE, }, { .procname =3D "msgmax", @@ -237,7 +229,6 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns) =20 } else if (tbl[i].data =3D=3D &init_ipc_ns.shm_rmid_forced) { tbl[i].data =3D &ns->shm_rmid_forced; - tbl[i].extra1 =3D ns; =20 } else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmax) { tbl[i].data =3D &ns->msg_ctlmax; @@ -250,7 +241,6 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns) =20 } else if (tbl[i].data =3D=3D &init_ipc_ns.sem_ctls) { tbl[i].data =3D &ns->sem_ctls; - tbl[i].extra1 =3D ns; #ifdef CONFIG_CHECKPOINT_RESTORE } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SEM_IDS].next_id) { tbl[i].data =3D &ns->ids[IPC_SEM_IDS].next_id; --=20 2.33.2 From nobody Wed May 13 18:35:51 2026 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 6B3AFC433EF for ; Fri, 22 Apr 2022 12:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233911AbiDVM6B (ORCPT ); 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: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 *t= able, int write, void *buffer, size_t *lenp, loff_t *ppos) { - struct ipc_namespace *ns =3D table->extra1; + struct ipc_namespace *ns =3D current->nsproxy->ipc_ns; struct ctl_table ipc_table; =20 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 =3D=3D &init_ipc_ns.ids[IPC_SEM_IDS].next_id) { tbl[i].data =3D &ns->ids[IPC_SEM_IDS].next_id; - tbl[i].extra1 =3D ns; =20 } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_MSG_IDS].next_id) { tbl[i].data =3D &ns->ids[IPC_MSG_IDS].next_id; - tbl[i].extra1 =3D ns; =20 } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SHM_IDS].next_id) { tbl[i].data =3D &ns->ids[IPC_SHM_IDS].next_id; - tbl[i].extra1 =3D ns; #endif } else { tbl[i].data =3D NULL; --=20 2.33.2 From nobody Wed May 13 18:35:51 2026 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 1A97CC433F5 for ; Fri, 22 Apr 2022 12:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233805AbiDVM54 (ORCPT ); Fri, 22 Apr 2022 08:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233826AbiDVM4z (ORCPT ); Fri, 22 Apr 2022 08:56:55 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A1386527F5 for ; Fri, 22 Apr 2022 05:54:02 -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-369-Yr3lvMn-Mpec8zFWnc3kCg-1; Fri, 22 Apr 2022 08:53:58 -0400 X-MC-Unique: Yr3lvMn-Mpec8zFWnc3kCg-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 12A603C1E8FA; Fri, 22 Apr 2022 12:53:57 +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 57964C44CCF; Fri, 22 Apr 2022 12:53:54 +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 3/4] ipc: Check permissions for checkpoint_restart sysctls at open time Date: Fri, 22 Apr 2022 14:53:39 +0200 Message-Id: <8b415b6b297d1143106bbcf57a269eb744bfdf81.1650631347.git.legion@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As Eric Biederman pointed out, it is possible not to use a custom proc_handler and check permissions for every write, but to use a .permission handler. That will allow the checkpoint_restart sysctls to perform all of their permission checks at open time, and not need any other special code. Link: https://lore.kernel.org/lkml/87czib9g38.fsf@email.froward.int.ebieder= m.org/ Signed-off-by: Eric W. Biederman Signed-off-by: Alexey Gladkov --- ipc/ipc_sysctl.c | 54 ++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index ff99d0305a5b..5a58598d48c8 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -68,25 +68,6 @@ static int proc_ipc_sem_dointvec(struct ctl_table *table= , int write, return ret; } =20 -#ifdef CONFIG_CHECKPOINT_RESTORE -static int proc_ipc_dointvec_minmax_checkpoint_restore(struct ctl_table *t= able, - int write, void *buffer, size_t *lenp, loff_t *ppos) -{ - struct ipc_namespace *ns =3D current->nsproxy->ipc_ns; - struct ctl_table ipc_table; - - if (write && !checkpoint_restore_ns_capable(ns->user_ns)) - return -EPERM; - - memcpy(&ipc_table, table, sizeof(ipc_table)); - - ipc_table.extra1 =3D SYSCTL_ZERO; - ipc_table.extra2 =3D SYSCTL_INT_MAX; - - return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos); -} -#endif - int ipc_mni =3D IPCMNI; int ipc_mni_shift =3D IPCMNI_SHIFT; int ipc_min_cycle =3D RADIX_TREE_MAP_SIZE; @@ -172,22 +153,28 @@ static struct ctl_table ipc_sysctls[] =3D { .procname =3D "sem_next_id", .data =3D &init_ipc_ns.ids[IPC_SEM_IDS].next_id, .maxlen =3D sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id), - .mode =3D 0666, - .proc_handler =3D proc_ipc_dointvec_minmax_checkpoint_restore, + .mode =3D 0444, + .proc_handler =3D proc_dointvec_minmax, + .extra1 =3D SYSCTL_ZERO, + .extra2 =3D SYSCTL_INT_MAX, }, { .procname =3D "msg_next_id", .data =3D &init_ipc_ns.ids[IPC_MSG_IDS].next_id, .maxlen =3D sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id), - .mode =3D 0666, - .proc_handler =3D proc_ipc_dointvec_minmax_checkpoint_restore, + .mode =3D 0444, + .proc_handler =3D proc_dointvec_minmax, + .extra1 =3D SYSCTL_ZERO, + .extra2 =3D SYSCTL_INT_MAX, }, { .procname =3D "shm_next_id", .data =3D &init_ipc_ns.ids[IPC_SHM_IDS].next_id, .maxlen =3D sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id), - .mode =3D 0666, - .proc_handler =3D proc_ipc_dointvec_minmax_checkpoint_restore, + .mode =3D 0444, + .proc_handler =3D proc_dointvec_minmax, + .extra1 =3D SYSCTL_ZERO, + .extra2 =3D SYSCTL_INT_MAX, }, #endif {} @@ -203,8 +190,25 @@ static int set_is_seen(struct ctl_table_set *set) return ¤t->nsproxy->ipc_ns->ipc_set =3D=3D set; } =20 +static int ipc_permissions(struct ctl_table_header *head, struct ctl_table= *table) +{ + int mode =3D table->mode; + +#ifdef CONFIG_CHECKPOINT_RESTORE + struct ipc_namespace *ns =3D current->nsproxy->ipc_ns; + + if (((table->data =3D=3D &ns->ids[IPC_SEM_IDS].next_id) || + (table->data =3D=3D &ns->ids[IPC_MSG_IDS].next_id) || + (table->data =3D=3D &ns->ids[IPC_SHM_IDS].next_id)) && + checkpoint_restore_ns_capable(ns->user_ns)) + mode =3D 0666; +#endif + return mode; +} + static struct ctl_table_root set_root =3D { .lookup =3D set_lookup, + .permissions =3D ipc_permissions, }; =20 bool setup_ipc_sysctls(struct ipc_namespace *ns) --=20 2.33.2 From nobody Wed May 13 18:35:51 2026 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 03A88C433F5 for ; Fri, 22 Apr 2022 12:54:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233837AbiDVM5q (ORCPT ); Fri, 22 Apr 2022 08:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234030AbiDVM5C (ORCPT ); Fri, 22 Apr 2022 08:57:02 -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 C41B2527F5 for ; Fri, 22 Apr 2022 05:54:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-2bZdEIVWPhG6siyfIglrFQ-1; Fri, 22 Apr 2022 08:54:00 -0400 X-MC-Unique: 2bZdEIVWPhG6siyfIglrFQ-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 DE24F185A7B2; Fri, 22 Apr 2022 12:53:59 +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 571E0C44AE4; Fri, 22 Apr 2022 12:53:57 +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 4/4] ipc: Remove extra braces Date: Fri, 22 Apr 2022 14:53:40 +0200 Message-Id: <8f645e997ff805dcb410cfdd09df9e475c6c845e.1650631347.git.legion@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix coding style. In the previous commit, I added braces because, in addition to changing .data, .extra1 also changed. Now this is not needed. Signed-off-by: Alexey Gladkov --- ipc/ipc_sysctl.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 5a58598d48c8..ef313ecfb53a 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c @@ -222,42 +222,41 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns) int i; =20 for (i =3D 0; i < ARRAY_SIZE(ipc_sysctls); i++) { - if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlmax) { + if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlmax) tbl[i].data =3D &ns->shm_ctlmax; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlall) { + else if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlall) tbl[i].data =3D &ns->shm_ctlall; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlmni) { + else if (tbl[i].data =3D=3D &init_ipc_ns.shm_ctlmni) tbl[i].data =3D &ns->shm_ctlmni; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.shm_rmid_forced) { + else if (tbl[i].data =3D=3D &init_ipc_ns.shm_rmid_forced) tbl[i].data =3D &ns->shm_rmid_forced; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmax) { + else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmax) tbl[i].data =3D &ns->msg_ctlmax; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmni) { + else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmni) tbl[i].data =3D &ns->msg_ctlmni; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmnb) { + else if (tbl[i].data =3D=3D &init_ipc_ns.msg_ctlmnb) tbl[i].data =3D &ns->msg_ctlmnb; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.sem_ctls) { + else if (tbl[i].data =3D=3D &init_ipc_ns.sem_ctls) tbl[i].data =3D &ns->sem_ctls; #ifdef CONFIG_CHECKPOINT_RESTORE - } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SEM_IDS].next_id) { + else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SEM_IDS].next_id) tbl[i].data =3D &ns->ids[IPC_SEM_IDS].next_id; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_MSG_IDS].next_id) { + else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_MSG_IDS].next_id) tbl[i].data =3D &ns->ids[IPC_MSG_IDS].next_id; =20 - } else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SHM_IDS].next_id) { + else if (tbl[i].data =3D=3D &init_ipc_ns.ids[IPC_SHM_IDS].next_id) tbl[i].data =3D &ns->ids[IPC_SHM_IDS].next_id; #endif - } else { + else tbl[i].data =3D NULL; - } } =20 ns->ipc_sysctls =3D __register_sysctl_table(&ns->ipc_set, "kernel", tbl); --=20 2.33.2