1. 08 May, 2007 2 commits
  2. 16 Feb, 2007 3 commits
  3. 26 Mar, 2006 2 commits
  4. 25 Mar, 2006 2 commits
    • Thomas Gleixner's avatar
      [PATCH] Validate and sanitze itimer timeval from userspace · 7d99b7d6
      Thomas Gleixner authored
      
      According to the specification the timevals must be validated and an
      errorcode -EINVAL returned in case the timevals are not in canonical form.
      This check was never done in Linux.
      
      The pre 2.6.16 code converted invalid timevals silently.  Negative timeouts
      were converted by the timeval_to_jiffies conversion to the maximum timeout.
      
      hrtimers and the ktime_t operations expect timevals in canonical form.
      Otherwise random results might happen on 32 bits machines due to the
      optimized ktime_add/sub operations.  Negative timeouts are treated as
      already expired.  This might break applications which work on pre 2.6.16.
      
      To prevent random behaviour and API breakage the timevals are checked and
      invalid timevals sanitized in a simliar way as the pre 2.6.16 code did.
      
      Invalid timevals are reported with a per boot limited number of kernel
      messages so applications which use this misfeature can be corrected.
      
      After a grace period of one year the sanitizing should be replaced by a
      correct validation check.  This is also documented in
      Documentation/feature-removal-schedule.txt
      
      The validation and sanitizing is done inside do_setitimer so all callers
      (sys_setitimer, compat_sys_setitimer, osf_setitimer) are catched.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7d99b7d6
    • Thomas Gleixner's avatar
      [PATCH] sys_alarm() unsigned signed conversion fixup · c08b8a49
      Thomas Gleixner authored
      
      alarm() calls the kernel with an unsigend int timeout in seconds.  The
      value is stored in the tv_sec field of a struct timeval to setup the
      itimer.  The tv_sec field of struct timeval is of type long, which causes
      the tv_sec value to be negative on 32 bit machines if seconds > INT_MAX.
      
      Before the hrtimer merge (pre 2.6.16) such a negative value was converted
      to the maximum jiffies timeout by the timeval_to_jiffies conversion.  It's
      not clear whether this was intended or just happened to be done by the
      timeval_to_jiffies code.
      
      hrtimers expect a timeval in canonical form and treat a negative timeout as
      already expired.  This breaks the legitimate usage of alarm() with a
      timeout value > INT_MAX seconds.
      
      For 32 bit machines it is therefor necessary to limit the internal seconds
      value to avoid API breakage.  Instead of doing this in all implementations
      of sys_alarm the duplicated sys_alarm code is moved into a common function
      in itimer.c
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c08b8a49
  5. 01 Feb, 2006 2 commits
  6. 10 Jan, 2006 1 commit
  7. 27 Jul, 2005 1 commit
  8. 29 Jun, 2005 1 commit
  9. 05 May, 2005 1 commit
    • Paulo Marques's avatar
      [PATCH] setitimer timer expires too early · b7e4e853
      Paulo Marques authored
      
      It seems that the code responsible for this is in kernel/itimer.c:126:
      
      	p->signal->real_timer.expires = jiffies + interval;
      	add_timer(&p->signal->real_timer);
      
      If you request an interval of, lets say 900 usecs, the interval given by
      timeval_to_jiffies will be 1.
      
      If you request this when we are half-way between two timer ticks, the
      interval will only give 400 usecs.
      
      If we want to guarantee that we never ever give intervals less than
      requested, the simple solution would be to change that to:
      
      	p->signal->real_timer.expires = jiffies + interval + 1;
      
      This however will produce pathological cases, like having a idle system
      being requested 1 ms timeouts will give systematically 2 ms timeouts,
      whereas currently it simply gives a few usecs less than 1 ms.
      
      The complex (and more computationally expensive) solution would be to
      check the gettimeofday time, and compute the correct number of jiffies.
      This way, if we request a 300 usecs timer 200 usecs inside the timer
      tick, we can wait just one tick, but not if we are 800 usecs inside the
      tick. This would also mean that we would have to lock preemption during
      these computations to avoid races, etc.
      
      I've searched the archives but couldn't find this particular issue being
      discussed before.
      
      Attached is a patch to do the simple solution, in case anybody thinks
      that it should be used.
      Signed-Off-By: default avatarPaulo Marques <pmarques@grupopie.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b7e4e853
  10. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4