kernel-hacking-2024-linux-s.../kernel
Thomas Gleixner c08b8a4910 [PATCH] sys_alarm() unsigned signed conversion fixup
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: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 08:22:48 -08:00
..
irq
power [PATCH] sem2mutex: kernel/ 2006-03-23 07:38:10 -08:00
.gitignore
acct.c
audit.c
auditsc.c Merge ../powerpc-merge 2006-02-24 14:05:47 +11:00
capability.c
compat.c [PATCH] remove bogus asm/bug.h includes. 2006-02-07 20:56:35 -05:00
configs.c
cpu.c
cpuset.c [PATCH] cpuset: remove useless local variable initialization 2006-03-24 07:33:24 -08:00
dma.c
exec_domain.c [PATCH] Fix module refcount leak in __set_personality() 2006-03-24 07:33:30 -08:00
exit.c [PATCH] sem2mutex: tty 2006-03-23 07:38:11 -08:00
extable.c
fork.c [PATCH] cpuset memory spread slab cache optimizations 2006-03-24 07:33:23 -08:00
futex.c
hrtimer.c [PATCH] fix next_timer_interrupt() for hrtimer 2006-03-06 18:40:44 -08:00
intermodule.c [PATCH] missing license tag in intermodule 2006-02-05 11:06:52 -08:00
itimer.c [PATCH] sys_alarm() unsigned signed conversion fixup 2006-03-25 08:22:48 -08:00
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kmod.c
kprobes.c [PATCH] sem2mutex: kprobes 2006-03-23 07:38:12 -08:00
ksysfs.c [PATCH] fix build error if CONFIG_SYSFS=n 2006-03-24 07:33:31 -08:00
kthread.c [PATCH] sem2mutex: kernel/ 2006-03-23 07:38:10 -08:00
Makefile [PATCH] relay: migrate from relayfs to a generic relay API 2006-03-23 19:56:55 +01:00
module.c [PATCH] strndup_user: convert module 2006-03-24 07:33:31 -08:00
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
panic.c [PATCH] pause_on_oops command line option 2006-03-23 07:38:16 -08:00
params.c [PATCH] fix module sysfs files reference counting 2006-03-20 13:42:58 -08:00
pid.c
posix-cpu-timers.c
posix-timers.c [PATCH] sem2mutex: kernel/ 2006-03-23 07:38:10 -08:00
printk.c [PATCH] console_setup() depends (wrongly?) on CONFIG_PRINTK 2006-03-24 07:33:27 -08:00
profile.c [PATCH] sem2mutex: kernel/ 2006-03-23 07:38:10 -08:00
ptrace.c [PATCH] fix zap_thread's ptrace related problems 2006-02-15 11:05:43 -08:00
rcupdate.c [PATCH] rcu_process_callbacks: don't cli() while testing ->nxtlist 2006-03-24 07:33:20 -08:00
rcutorture.c [PATCH] rcutorture: tag success/failure line with module parameters 2006-03-24 07:33:22 -08:00
relay.c [PATCH] relay: consolidate sendfile() and read() code 2006-03-23 19:58:45 +01:00
resource.c
sched.c [PATCH] make bug messages more consistent 2006-03-23 07:38:16 -08:00
seccomp.c
signal.c [PATCH] sigprocmask: kill unneeded temp var 2006-03-23 07:38:15 -08:00
softirq.c [PATCH] on_each_cpu(): disable local interrupts 2006-03-22 07:53:59 -08:00
softlockup.c [PATCH] timer irq driven soft watchdog fix 2006-03-25 08:22:48 -08:00
spinlock.c [PATCH] BUILD_LOCK_OPS: cleanup preempt_disable() usage 2006-03-23 07:38:16 -08:00
stop_machine.c
sys.c [PATCH] RLIMIT_CPU: document wrong return value 2006-03-24 07:33:30 -08:00
sys_ni.c [PATCH] Fix compile for CONFIG_SYSVIPC=n or CONFIG_SYSCTL=n 2006-02-20 20:00:11 -08:00
sysctl.c [PATCH] Range checking in do_proc_dointvec_(userhz_)jiffies_conv 2006-03-24 07:33:20 -08:00
time.c [PATCH] Normalize timespec for negative values in ns_to_timespec 2006-02-03 08:32:06 -08:00
timer.c [PATCH] sys_alarm() unsigned signed conversion fixup 2006-03-25 08:22:48 -08:00
uid16.c
user.c [PATCH] free_uid() locking improvement 2006-03-24 07:33:20 -08:00
wait.c
workqueue.c [SCSI] add execute_in_process_context() API 2006-02-27 23:34:40 -06:00