All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Tom Rini <trini@kernel.crashing.org>
Subject: Re: [patch 1/2] Validate itimer timeval from userspace
Date: Sat, 18 Mar 2006 20:57:43 +0100	[thread overview]
Message-ID: <1142711863.17279.124.camel@localhost.localdomain> (raw)
In-Reply-To: <20060318191006.GA3939@elte.hu>

On Sat, 2006-03-18 at 20:10 +0100, Ingo Molnar wrote:
> * Thomas Gleixner <tglx@linutronix.de> wrote:
> 
> > According to the specification the timeval must be validated and an 
> > errorcode -EINVAL returned in case the timeval is not in canonical 
> > form. Before the hrtimer merge this was silently ignored by the 
> > timeval to jiffies conversion. The validation is done inside 
> > do_setitimer so all callers are catched.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> ok - bad (invalid) timevals were thus randomly interpreted? I agree that 
> even though this is new behavior, it is much better to return -EINVAL 
> than to behave randomly. OTOH, since 2.6.15 and earlier did this too, is 
> there any urgency to apply this to 2.6.16?

Sorry, I explained it badly.

The negative timer values were converted to MAX_JIFFIES_PER_LONG
timeouts and intervals.

The hrtimer code expects canonical values for the start time and the
interval. The random non canonical values should not do any damage, but
the normalizing routines might loop for a while. The negative start time
will be treated as expired and negative intervals are adjusted to
resolution (jiffie) in the hrtimer_forward code.

So the behaviour is different anyway, but I prefer the clear -EINVAL to
randomness.

	tglx



  reply	other threads:[~2006-03-18 19:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18 15:18 [patch 0/2] sys_setitimer and sys_alarm hotfixes Thomas Gleixner
2006-03-18 15:18 ` [patch 1/2] Validate itimer timeval from userspace Thomas Gleixner
2006-03-18 19:10   ` Ingo Molnar
2006-03-18 19:57     ` Thomas Gleixner [this message]
2006-03-18 20:07   ` Andrew Morton
2006-03-18 20:16     ` Thomas Gleixner
2006-03-18 20:31       ` Andrew Morton
2006-03-18 20:38         ` Thomas Gleixner
2006-03-18 21:09           ` Andrew Morton
2006-03-18 21:26             ` Jesper Juhl
2006-03-18 21:33               ` Andrew Morton
2006-03-18 21:50                 ` Jesper Juhl
2006-03-18 22:05             ` Thomas Gleixner
2006-03-18 22:25               ` Andrew Morton
2006-03-18 23:12                 ` tglx
2006-03-18 20:45         ` Jesper Juhl
2006-03-18 22:02           ` Ray Lee
2006-03-18 23:14           ` Eric Piel
2006-03-19  8:55             ` Kyle Moffett
2006-03-18 20:23     ` Jesper Juhl
2006-03-18 20:30       ` Thomas Gleixner
2006-03-18 21:04         ` Andrew Morton
2006-03-21 15:31           ` Pavel Machek
2006-03-18 15:18 ` [patch 2/2] alarm unsigned signed conversion fixup Thomas Gleixner
2006-03-18 20:02   ` Thomas Gleixner
2006-03-18 20:12   ` Andrew Morton
2006-03-18 20:27     ` Thomas Gleixner
2006-03-18 21:06       ` Andrew Morton

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=1142711863.17279.124.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=trini@kernel.crashing.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.