archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <>
To: "Luis R. Rodriguez" <>,
	Kees Cook <>,
	Andrew Morton <>,
	Jonathan Corbet <>
Cc:,,, Al Viro <>,
	Matthew Wilcox <>,
	"Eric W. Biederman" <>,
	Takashi Iwai <>, Davidlohr Bueso <>,
	Waiman Long <>
Subject: [PATCH v8 0/5] ipc: IPCMNI limit check for *mni & increase that limit
Date: Mon, 18 Jun 2018 18:28:13 +0800	[thread overview]
Message-ID: <> (raw)

 - Remove the __read_mostly tag for ipc_mni and related variables as their
   accesses are not really in performance critical path.
 - Add a new ipcmni_compat sysctl parameter that can be set to restore old
   range check behavior if desired.

 - Drop the range clamping code and just return error instead for now
   until there is user request for clamping support.
 - Fix compilation error when CONFIG_SYSVIPC_SYSCTL isn't defined.

 - Consolidate the 3 ctl_table flags into 2.
 - Make similar changes to proc_doulongvec_minmax() and its associates
   to complete the clamping change.
 - Remove the sysctl registration failure test patch for now for later
 - Add extra braces to patch 1 to reduce code diff in a later patch.

 - Revert the flags back to 16-bit so that there will be no change to
   the size of ctl_table.
 - Enhance the sysctl_check_flags() as requested by Luis to perform more
   checks to spot incorrect ctl_table entries.
 - Change the sysctl selftest to use dummy sysctls instead of production
   ones & enhance it to do more checks.
 - Add one more sysctl selftest for registration failure.
 - Add 2 ipc patches to add an extended mode to increase IPCMNI from
   32k to 2M.
 - Miscellaneous change to incorporate feedback comments from

 - Remove v3 patches 1 & 2 as they have been merged into the mm tree.
 - Change flags from uint16_t to unsigned int.
 - Remove CTL_FLAGS_OOR_WARNED and use pr_warn_ratelimited() instead.
 - Simplify the warning message code.
 - Add a new patch to fail the ctl_table registration with invalid flag.
 - Add a test case for range clamping in sysctl selftest.

 - Fix kdoc comment errors.
 - Incorporate comments and suggestions from Luis R. Rodriguez.
 - Add a patch to fix a typo error in fs/proc/proc_sysctl.c.

 - Add kdoc comments to the do_proc_do{u}intvec_minmax_conv_param
 - Add a new flags field to the ctl_table structure for specifying
   whether range clamping should be activated instead of adding new
   sysctl parameter handlers.
 - Clamp the semmni value embedded in the multi-values sem parameter.

v5 patch:
v6 patch:
v7 patch:

The sysctl parameters msgmni, shmmni and semmni have an inherent limit
of IPC_MNI (32k). However, users may not be aware of that because they
can write a value much higher than that without getting any error or
notification. Reading the parameters back will show the newly written
values which are not real.

The real IPCMNI limit is now enforced to make sure that users won't
put in an unrealistic value. The first 2 patches enforce the limits.

There are also users out there requesting increase in the IPCMNI value.
The last 2 patches attempt to do that by using a boot kernel parameter
"ipcmni_extend" to increase the IPCMNI limit from 32k to 2M if the users
really want the extended value.

Enforcing the range limit check may cause some existing applications to break
if they unwittingly set a value higher than 32k. To allow system administrators
to work around this issue, a new ipcmni_compat sysctl parameter can now be set
to restore the old behavior. This compatibility mode can only be set if the
ipcmni_extend boot parameter is not specified. Patch 5 implements this new
sysctl parameter.

Waiman Long (5):
  ipc: IPCMNI limit check for msgmni and shmmni
  ipc: IPCMNI limit check for semmni
  ipc: Allow boot time extension of IPCMNI from 32k to 2M
  ipc: Conserve sequence numbers in extended IPCMNI mode
  ipc: Add a new ipcmni_compat sysctl to fall back to old behavior

 Documentation/admin-guide/kernel-parameters.txt |  3 +
 Documentation/sysctl/kernel.txt                 | 15 +++++
 include/linux/ipc_namespace.h                   |  1 +
 ipc/ipc_sysctl.c                                | 78 ++++++++++++++++++++++++-
 ipc/util.c                                      | 41 ++++++++-----
 ipc/util.h                                      | 50 +++++++++++++---
 6 files changed, 164 insertions(+), 24 deletions(-)


             reply	other threads:[~2018-06-18 10:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 10:28 Waiman Long [this message]
2018-06-18 10:28 ` [PATCH v8 1/5] ipc: IPCMNI limit check for msgmni and shmmni Waiman Long
2018-06-28  3:16   ` Luis R. Rodriguez
2018-08-17 16:51   ` Davidlohr Bueso
2018-06-18 10:28 ` [PATCH v8 2/5] ipc: IPCMNI limit check for semmni Waiman Long
2018-06-28 22:39   ` Luis R. Rodriguez
2018-06-29  7:26     ` Waiman Long
2018-08-17 16:53   ` Davidlohr Bueso
2018-06-18 10:28 ` [PATCH v8 3/5] ipc: Allow boot time extension of IPCMNI from 32k to 2M Waiman Long
2018-08-17 16:45   ` Davidlohr Bueso
2018-08-18  1:15     ` Waiman Long
2018-10-02 16:32       ` Manfred Spraul
2018-10-02 17:43         ` Waiman Long
2018-06-18 10:28 ` [PATCH v8 4/5] ipc: Conserve sequence numbers in extended IPCMNI mode Waiman Long
2018-06-18 10:28 ` [PATCH v8 5/5] ipc: Add a new ipcmni_compat sysctl to fall back to old behavior Waiman Long
2018-06-18 11:36   ` kbuild test robot
2018-06-18 14:27   ` kbuild test robot
2018-08-17 16:50 ` [PATCH v8 0/5] ipc: IPCMNI limit check for *mni & increase that limit Davidlohr Bueso
2018-09-06 22:24   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).