alistair23-linux/kernel
BP, Praveen bd9b0bac6f [PATCH] sysctl: string length calculated is wrong if it contains negative numbers
In the functions do_proc_dointvec() and do_proc_doulongvec_minmax(),
there seems to be a bug in string length calculation if string contains
negative integer.

The console log given below explains the bug. Setting negative values
may not be a right thing to do for "console log level" but then the test
(given below) can be used to demonstrate the bug in the code.

# echo "-1 -1 -1 -123456" > /proc/sys/kernel/printk
# cat /proc/sys/kernel/printk
-1      -1      -1      -1234
#
# echo "-1 -1 -1 123456" > /proc/sys/kernel/printk
# cat /proc/sys/kernel/printk
-1      -1      -1      1234
#

(akpm: the bug is that 123456 gets truncated)

It works as expected if string contains all +ve integers

# echo "1 2 3 4" > /proc/sys/kernel/printk
# cat /proc/sys/kernel/printk
1       2       3       4
#

The patch given below fixes the issue.

Signed-off-by: Praveen BP <praveenbp@ti.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:42 -08:00
..
irq [PATCH] lockdep: name some old style locks 2006-12-07 08:39:36 -08:00
power [PATCH] Export pm_suspend for the shared APM emulation 2006-12-07 08:39:32 -08:00
time [PATCH] time_adjust cleared before use 2006-10-28 11:30:55 -07:00
.gitignore
acct.c [PATCH] lockdep: name some old style locks 2006-12-07 08:39:36 -08:00
audit.c [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
audit.h
auditfilter.c [PATCH] kernel core: replace kmalloc+memset with kzalloc 2006-12-07 08:39:41 -08:00
auditsc.c [PATCH] severing skbuff.h -> highmem.h 2006-12-04 02:00:29 -05:00
capability.c
compat.c [PATCH] Create compat_sys_migrate_pages 2006-11-03 12:27:59 -08:00
configs.c
cpu.c [PATCH] suspend: don't change cpus_allowed for task initiating the suspend 2006-12-07 08:39:28 -08:00
cpuset.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
delayacct.c [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
dma.c [PATCH] kernel-doc for kernel/dma.c 2006-10-03 08:03:41 -07:00
exec_domain.c
exit.c [PATCH] taskstats: cleanup do_exit() path 2006-12-07 08:39:34 -08:00
extable.c
fork.c [PATCH] taskstats: cleanup ->signal->stats allocation 2006-12-07 08:39:34 -08:00
futex.c [PATCH] futex: init error check 2006-12-07 08:39:41 -08:00
futex_compat.c [PATCH] __user annotations: futex 2006-10-10 15:37:22 -07:00
hrtimer.c [PATCH] posix-timers: Fix clock_nanosleep() doesn't return the remaining time in compatibility mode 2006-09-29 09:18:15 -07:00
itimer.c
kallsyms.c [PATCH] /proc/kallsyms reports lower-case types for some non-exported symbols 2006-12-07 08:39:31 -08:00
Kconfig.hz [PATCH] HZ: 300Hz support 2006-12-07 08:39:36 -08:00
Kconfig.preempt
kexec.c [PATCH] kernel core: replace kmalloc+memset with kzalloc 2006-12-07 08:39:41 -08:00
kfifo.c
kmod.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 14:37:56 +00:00
kprobes.c [PATCH] kprobes: enable booster on the preemptible kernel 2006-12-07 08:39:38 -08:00
ksysfs.c
kthread.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
latency.c [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
lockdep.c [PATCH] remove kernel/lockdep.c:lockdep_internal 2006-12-07 08:39:39 -08:00
lockdep_internals.h
lockdep_proc.c
Makefile [PATCH] srcu-3: RCU variant permitting read-side blocking 2006-10-04 07:55:30 -07:00
module.c [PATCH] severing module.h->sched.h 2006-12-04 02:00:22 -05:00
mutex-debug.c Lockdep: add lockdep_set_class_and_subclass() and lockdep_set_subclass() 2006-10-11 01:45:14 -04:00
mutex-debug.h
mutex.c
mutex.h
nsproxy.c [PATCH] kernel/nsproxy.c: use kmemdup() 2006-10-20 10:26:44 -07:00
panic.c [PATCH] x86: Clean up x86 NMI sysctls 2006-09-30 01:47:55 +02:00
params.c
pid.c [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
posix-cpu-timers.c [PATCH] posix-cpu-timers: prevent signal delivery starvation 2006-10-17 08:18:43 -07:00
posix-timers.c [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
printk.c [PATCH] remove the syslog interface when printk is disabled 2006-12-07 08:39:38 -08:00
profile.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
ptrace.c
rcupdate.c [PATCH] rcu: add a prefetch() in rcu_do_batch() 2006-12-07 08:39:40 -08:00
rcutorture.c [PATCH] rcu: add sched torture type to rcutorture 2006-10-04 07:55:31 -07:00
relay.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
resource.c [PATCH] kernel-doc for kernel/resource.c 2006-10-03 08:03:41 -07:00
rtmutex-debug.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
rtmutex-debug.h
rtmutex-tester.c [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
rtmutex.c
rtmutex.h
rtmutex_common.h
rwsem.c
sched.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
seccomp.c
signal.c [PATCH] make kernel/signal.c:kill_proc_info() static 2006-12-07 08:39:39 -08:00
softirq.c [PATCH] check return value of cpu_callback 2006-09-29 09:18:14 -07:00
softlockup.c [PATCH] check return value of cpu_callback 2006-09-29 09:18:14 -07:00
spinlock.c [PATCH] lockdep: spin_lock_irqsave_nested() 2006-11-25 13:28:34 -08:00
srcu.c [PATCH] SRCU: report out-of-memory errors 2006-10-04 07:55:30 -07:00
stacktrace.c
stop_machine.c [PATCH] stop_machine.c copyright 2006-09-29 09:18:24 -07:00
sys.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
sys_ni.c [PATCH] Create compat_sys_migrate_pages 2006-11-03 12:27:59 -08:00
sysctl.c [PATCH] sysctl: string length calculated is wrong if it contains negative numbers 2006-12-07 08:39:42 -08:00
taskstats.c [PATCH] taskstats: cleanup reply assembling 2006-12-07 08:39:34 -08:00
time.c [PATCH] NTP: Move all the NTP related code to ntp.c 2006-10-01 00:39:26 -07:00
timer.c [PATCH] kill wall_jiffies 2006-10-01 00:39:27 -07:00
tsacct.c [PATCH] xacct_add_tsk: fix pure theoretical ->mm use-after-free 2006-10-30 12:08:41 -08:00
uid16.c
unwind.c [PATCH] x86-64: work around gcc4 issue with -Os in Dwarf2 stack unwind 2006-11-28 20:12:59 +01:00
user.c [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
utsname.c [PATCH] namespaces: utsname: implement CLONE_NEWUTS flag 2006-10-02 07:57:22 -07:00
wait.c
workqueue.c [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00