mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Kees Cook <keescook@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 2/3] sysctl: Warn when a clamped sysctl parameter is set out of range
Date: Wed, 21 Feb 2018 10:33:58 -0500	[thread overview]
Message-ID: <a178999f-84f7-db25-2db0-8257208cfc2b@redhat.com> (raw)
In-Reply-To: <CAGXu5jJxj77yH8reSaQDp26D1tEvQVaiuL99uYuukCTc5FbfHA@mail.gmail.com>

On 02/20/2018 08:26 PM, Kees Cook wrote:
> On Tue, Feb 20, 2018 at 3:17 PM, Andrew Morton
> <akpm@linux-foundation.org> wrote:
>> On Mon, 19 Feb 2018 11:53:50 -0500 Waiman Long <longman@redhat.com> wrote:
>>
>>> Even with clamped sysctl parameters, it is still not that straight
>>> forward to figure out the exact range of those parameters. One may
>>> try to write extreme parameter values to see if they get clamped.
>>> To make it easier, a warning with the expected range will now be
>>> printed in the kernel ring buffer when a clamped sysctl parameter
>>> receives an out of range value.
>> This assumes that do_proc_dointvec_minmax_conv() and
>> do_proc_douintvec_minmax_conv() are only ever called by privileged
>> userspace.  Because we mustn't give unprivileged applications a way to
>> spam the kernel logs.
>>
>> That's presumably true in the case of the caller you just added, but I
>> don't see what we can do to guarantee this in the future, so perhaps we
>> should add some permission check to the pr_warn()?
> How about pr_warn_ratelimited() instead?
>
> -Kees
>
My current thinking is to issue at most one warning per sysctl parameter
as additional warning of the same kind does not provide additional
information.

-Longman

  reply	other threads:[~2018-02-21 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 16:53 [PATCH 0/3] ipc: Clamp msgmni and shmmni to the real IPC_MNI limit Waiman Long
2018-02-19 16:53 ` [PATCH 1/3] sysctl: Add range clamping intvec helper functions Waiman Long
2018-02-20 23:41   ` Luis R. Rodriguez
2018-02-21 16:58     ` Waiman Long
2018-02-19 16:53 ` [PATCH 2/3] sysctl: Warn when a clamped sysctl parameter is set out of range Waiman Long
2018-02-20 23:17   ` Andrew Morton
2018-02-20 23:55     ` Luis R. Rodriguez
2018-02-21  1:26     ` Kees Cook
2018-02-21 15:33       ` Waiman Long [this message]
2018-02-21 15:24     ` Waiman Long
2018-02-19 16:53 ` [PATCH 3/3] ipc: Clamp msgmni and shmmni to the real IPC_MNI limit Waiman Long

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=a178999f-84f7-db25-2db0-8257208cfc2b@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

all inboxes | Powered by JetHome®