Received: by 10.213.65.68 with SMTP id h4csp520802imn; Tue, 13 Mar 2018 11:40:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELtnZX+gByUf8wbcO0HaKIzBzXlHqPhuFrO1XqbFYhLz1ZPai52FAslL+voQVY0l+Qkhq7oV X-Received: by 10.98.217.76 with SMTP id s73mr1510187pfg.209.1520966419738; Tue, 13 Mar 2018 11:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520966419; cv=none; d=google.com; s=arc-20160816; b=ZJ5aq3pUMIeYLAoN0a7UIjD1PGhAN8MYfBDRypOnuTW6m+Ag2HI8ZjKgFimdbOYtbx iQZctS7Qd2EcGRi22JG4fJ/6kquHZIOsdW1bGBnF31+9hRhTJlZ8Jz6E2Djqilj8paPF /TMepCYe9SzI2TIuJLMLvQXTNtdL2NKylspqBQWELMtSUZm0YVkyW3KnDi+xJ/rHPzwV jmyQV6Qs/JWGqb3dhCDdTdKnEdar/RMMWGMsS0qaYBMiwCE7Batr+bMiXheA5oKFplaO sdQf0b04ptxygx9JR6vdBRRGuPg/dBZDull4Dvre3jNXH80sOP/w8mvS3HpuuDX9yEQi 73fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=VPxiTDBDjwH8XJcG3K/NFslX9w1iaB0EaDFzvC1Io/Y=; b=yjaT0DDw1+F88/mru4ONqrt8bWDmoQxSIOb6LQcYlgDF9LJSjQed0GGsgkin6cqccF B/LseOUeBmgo02H5aS6DkoUYXRMhjx3JBrMZE9nq5L6jPhuHNs4UtFwMCeShPl2sxH7j xTE5+cbuvHAJlhKAvSI/sgLbZrgO6bgkrSAtmK/Apxw15p5vmvwO1nxjnV9H0ktj60sP vIHeHwByR2vlb6pxF+bx2m/DAiC7dXAhPqON5JKa0tx+4Jk8quItm39X3inJY0fdVbFh EQidWV92RaTNqw6c7UjOc1a9iPZnMkiSwz9BuB+6V1RdOK3LiR6SSUuNEyhgRtcjGyKK L7CA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si525143plg.618.2018.03.13.11.40.05; Tue, 13 Mar 2018 11:40:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbeCMSjL convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Mar 2018 14:39:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42672 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752000AbeCMSjJ (ORCPT ); Tue, 13 Mar 2018 14:39:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 252B07CBBA; Tue, 13 Mar 2018 18:39:09 +0000 (UTC) Received: from llong.remote.csb (ovpn-122-246.rdu2.redhat.com [10.10.122.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB760202322A; Tue, 13 Mar 2018 18:39:07 +0000 (UTC) Subject: Re: [PATCH v4 4/6] ipc: Clamp msgmni and shmmni to the real IPCMNI limit To: "Eric W. Biederman" Cc: "Luis R. Rodriguez" , Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Al Viro , Matthew Wilcox References: <1520885744-1546-1-git-send-email-longman@redhat.com> <1520885744-1546-5-git-send-email-longman@redhat.com> <87woyfyh57.fsf@xmission.com> From: Waiman Long Organization: Red Hat Message-ID: <5d4a858a-3136-5ef4-76fe-a61e7f2aed56@redhat.com> Date: Tue, 13 Mar 2018 14:39:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <87woyfyh57.fsf@xmission.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Mar 2018 18:39:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Mar 2018 18:39:09 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13/2018 02:17 PM, Eric W. Biederman wrote: > Waiman Long writes: > >> A user can write arbitrary integer values to msgmni and shmmni sysctl >> parameters without getting error, but the actual limit is really >> IPCMNI (32k). This can mislead users as they think they can get a >> value that is not real. >> >> Enforcing the limit by failing the sysctl parameter write, however, >> can break existing user applications. > Which applications examples please. > > I am seeing this patchset late but it looks like a whole lot of changes > to avoid a theoretical possibility. > > Changes that have an impact on more than just the ipc code you are > patching. > > That makes me feel very uncomfortable with these changes. > > Eric This patchset is constructed to address a customer request that there is no easy way to find out the actual usable range of a sysctl parameter. In this particular case, the customer wants to use more than 32k shared memory segments. They can put in a large value into shmmni, but the application didn't work properly because shmmni was internally clamped to 32k without any visible sign that a smaller limit has been imposed. Out of a concern that there might be customers out there setting those sysctl parameters outside of the allowable range without knowing it, just enforcing the right limits may have the undesirable consequence of breaking their existing setup scripts. I don't have concrete example of what customers are doing that, but it won't look good if we wait until the complaints come in. The new code won't affect existing code unless the necessary flag is set. So would you mind elaborating what other impact do you see that will affect other non-IPC code in an undesirable way? Cheers, Longman