]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kprobes: handle empty/invalid input to debugfs "enabled" file
authorMathias Krause <minipli@googlemail.com>
Fri, 7 Jun 2013 00:08:46 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Jun 2013 05:42:45 +0000 (15:42 +1000)
commit0aec8814080918ab3b15f0bcfaa6a60a5eb1eaa5
treee9290443d4921736e6ffe402ff5a8d4461766112
parent407d06781138a03e060ea5e6b701fd28ab8404cd
kprobes: handle empty/invalid input to debugfs "enabled" file

When writing invalid input to 'debug/kprobes/enabled' it'll silently be
ignored.  Even worse, when writing an empty string to this file, the
outcome is purely random as the switch statement will make its decision
based on the value of an uninitialized stack variable.

Fix this by handling invalid/empty input as error returning -EINVAL.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kprobes.c