All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sysctl: fix proc_doulongvec_ms_jiffies_minmax()
Date: Thu, 26 Jan 2017 09:25:08 -0800	[thread overview]
Message-ID: <CA+55aFw4FgM4xf2zq7z0UbR89GQnhyLERv0=42_v0=wkPz7q3Q@mail.gmail.com> (raw)
In-Reply-To: <1485397255.5145.103.camel@edumazet-glaptop3.roam.corp.google.com>

On Wed, Jan 25, 2017 at 6:20 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> We perform the conversion between kernel jiffies and ms only
> when exporting kernel value to user space.
>
> We need to do the opposite operation when value is written
> by user.

Applied. The interface is really confusing - I had to check whether
the min/max values were in jiffies or in ms, but it looks right. It
would probably be good to verify any overflow conditions, but we do
check the min/max after the conversion, so overflows are at least only
an inconvenience, not a "you can set invalid values".

The one overflow case I can imagine is trying to set some unlimited
value, and now due to the conversion math it's not unlimited any more,
and it just happened to work.

But the current code is clearly wrong. Of course, something might end
up depending on it being wrong, so..

           Linus

  reply	other threads:[~2017-01-26 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  2:20 [PATCH] sysctl: fix proc_doulongvec_ms_jiffies_minmax() Eric Dumazet
2017-01-26 17:25 ` Linus Torvalds [this message]
2017-01-26 18:06   ` Eric Dumazet

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='CA+55aFw4FgM4xf2zq7z0UbR89GQnhyLERv0=42_v0=wkPz7q3Q@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.