Received: by 10.213.65.68 with SMTP id h4csp291036imn; Mon, 12 Mar 2018 14:01:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELsCsmtTWlCxCA5v0zX77mANTvPxYeS1ru7tZA47Ju9Dz0JJ31WOs4JllcwcUVK+4THQruQN X-Received: by 10.98.234.22 with SMTP id t22mr9288612pfh.56.1520888489401; Mon, 12 Mar 2018 14:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520888489; cv=none; d=google.com; s=arc-20160816; b=uPgrVpY8EVsHEDfi03dmJSEoqNVFbBTsQmlp10NfB9GWBD0bxRtQYpbhic6k6LGuCb vT23NEFP0Z5s/tG15AUCwZ7EUXgsGObnALjOHfVRkijOBs5apKKS9aPveGLgdOzc65eN fW9Woc6+hFvnx2ncpKZqopktTVfOWEA+Oz6vS36E4cRzvirneYKKAcF8IMcLVdIxtM8P cFYFPwNQkHabXeslBHxdTJuXDR2qBzSJiH7JpYMR1cmkeW+N3MLolFbjbgPkBix2330M R1W2a7Y5DncvB0GFNW4LjdGXllxpiahlUkfMk8L0Gz/C+X/SDi61SE50tU8CzRdaDLoG iu8Q== 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=yMz6VezcBvAu6smSMWNuDSUfOt0dhwbvihq/aL8R3oQ=; b=W9RAusVJIn5QpZP8zIx0cNieTIOpmwEh1CLKfHcBieMT4gQf0R1T8CrLbMLR937p6x 2JimREK0bAnq3tTLcdqcCTkg3aMZr/fTbDUENoK5xWEnIJ8iwjDRRi60LIuxw4YIFgld qGT2o1SqovayWscyec1YPhTF1zfqfvD66YUHNMkJHXeB2465eUEErKS9+OLD27ZgpO9H rmVosbR/Vx++bfcOvWVrv5O0RMr4wiLzgDdDTB370geii7Qw0frmCnFPq9XilZ3SB17l SMV9GVan2WYy06euEQgucj6NM3xZL9n50lu7WAs3yvKEbkiSfJ0lauw91y36KZ2c3YV/ RV3A== 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 g10si5566195pgp.215.2018.03.12.14.01.14; Mon, 12 Mar 2018 14:01:29 -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 S932471AbeCLVAC (ORCPT + 99 others); Mon, 12 Mar 2018 17:00:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59474 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932302AbeCLVAA (ORCPT ); Mon, 12 Mar 2018 17:00:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38884BD9E; Mon, 12 Mar 2018 21:00:00 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-75.bos.redhat.com [10.18.17.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0504A2166BB2; Mon, 12 Mar 2018 20:59:59 +0000 (UTC) Subject: Re: [PATCH v4 5/6] ipc: Clamp semmni to the real IPCMNI limit To: "Luis R. Rodriguez" Cc: 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-6-git-send-email-longman@redhat.com> <20180312205235.GB4449@wotan.suse.de> From: Waiman Long Organization: Red Hat Message-ID: <1a506f57-a91b-aae9-7756-03268b6447f7@redhat.com> Date: Mon, 12 Mar 2018 16:59:59 -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: <20180312205235.GB4449@wotan.suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Mar 2018 21:00:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Mar 2018 21:00:00 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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/12/2018 04:52 PM, Luis R. Rodriguez wrote: > On Mon, Mar 12, 2018 at 04:15:43PM -0400, Waiman Long wrote: >> + if (clamped) >> + pr_warn_once("sysctl: \"sem[3]\" was set out of range [%d, %d], clamped to %d.\n", >> + 0, IPCMNI, ns->sc_semmni); > Why warn if the kernel already does that? If we can avoid more code on > drivers the better. > > Luis As said before, this case is special because "sem" is a collection of 4 different values. The last one is semmni which I tries to apply the same range clamping here, whereas the other 3 are left as they are. The standard proc_dointvec_minmax() handler cannot be used here because of that. I will clarify that in the commit log. Cheers, Longman