Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp985268imm; Fri, 17 Aug 2018 09:51:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzokCTru6bxGT8XRiNeFywQp0bZ0w5RZN8xB3Tov7bcM5bbfTOih3VCUA7bzc2xWs07TkXL X-Received: by 2002:a63:1126:: with SMTP id g38-v6mr33285475pgl.122.1534524702104; Fri, 17 Aug 2018 09:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534524702; cv=none; d=google.com; s=arc-20160816; b=Yb1j5WJZYao3QrJaWv6FXkX7nFPd7FNJAYELdnsteQu684eyKqe0oimBbPvnPIuyBk A7agl+2Y6D7R3g8RPmjElUDTy9hd1OPbuRIjAV0uZkmKB6xbN2w+NFT4YDUcBvEZIdFr rfOgdJ3FTfIMdP3+LKdEChMAkOs5HiIhXS+YDr3iMaW+v8OQPmlMJbWIsP/GG6X7u+f7 1tRFN9t1LAnpAnsFFv2VZBnSQQTZ2O+yf2UvYBt5TO84x+kiR0XU9WDZB6DQjbWDzKqn SIhfMuijaKKt4dfiUWwqPzZH4UNiENTXDfI4IPrcAJwf7Y7USgswPR5Yw4WvIcJLt2Tn n2SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rQYiRd1zqg0kXSmlmkWdOsBQ0vgXvyMaujS5DZnfzAs=; b=XMZNfgYIzQazRY16Y7RNlOwmUvh2DX9T+7EJLUmTNjLcj9LW9T7jIHvc2JxIArn1we TGmyVMRZjmZuYqUPkVvJr0/E/s/lUBLkCpphaPD/MIVlkhZxJ0V7TV7T4xjvRY2HqKwc ZXr38JV4a+FR0V5VfoPagguQb9YMPJoyM5Q5z1fXiK86l+uFpWrZl7Hxea5p45P+hB7V tUUMac9q8BpufJ1uWkBEjR9ZK5K1hfbD37T4YjL0sLDRsDkas6l4YsJLGE81MRrfAr1x eOHosb4mVbkcvHqWw+Xtx2ikZHMxoxqqCOTX5GyCsi2Itvz5oks/9QCUDDemtUdvGfCb fp3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si2440266pgi.184.2018.08.17.09.51.26; Fri, 17 Aug 2018 09:51:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727852AbeHQTyZ (ORCPT + 99 others); Fri, 17 Aug 2018 15:54:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:50484 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727218AbeHQTyZ (ORCPT ); Fri, 17 Aug 2018 15:54:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2207AADBB; Fri, 17 Aug 2018 16:50:18 +0000 (UTC) Date: Fri, 17 Aug 2018 09:50:08 -0700 From: Davidlohr Bueso To: Waiman Long Cc: "Luis R. Rodriguez" , Kees Cook , Andrew Morton , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, Al Viro , Matthew Wilcox , "Eric W. Biederman" , Takashi Iwai , Davidlohr Bueso , manfred@colorfullife.com Subject: Re: [PATCH v8 0/5] ipc: IPCMNI limit check for *mni & increase that limit Message-ID: <20180817165008.GB32382@linux-r8p5> References: <1529317698-16575-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1529317698-16575-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jun 2018, Waiman Long wrote: >v7->v8: > - 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. > >v6->v7: > - 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. > >v5->v6: > - 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 > consideration. > - Add extra braces to patch 1 to reduce code diff in a later patch. > >v4->v5: > - 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 > reviewers. > >v3->v4: > - 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. > >v2->v3: > - 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. > >v1->v2: > - Add kdoc comments to the do_proc_do{u}intvec_minmax_conv_param > structures. > - 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: https://lkml.org/lkml/2018/3/16/1106 >v6 patch: https://lkml.org/lkml/2018/4/27/1094 >v7 patch: https://lkml.org/lkml/2018/5/7/666 > >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 I've reviewed the first two which look good and are actual immediate fixes to the bogus user input. I haven't gotten around yet the rest of the patches but are at least a bit more controversial than the first two. As such, could patch 1 and 2 be picked up once the merge window closes, for v4.20? Although -stable might want in, this situation is quite historic, so it's not that urgent. Thanks, Davidlohr > 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(-) > >-- >1.8.3.1 >