]> git.baikalelectronics.ru Git - kernel.git/commit
debugfs: write_file_bool() - ensure strtobool() operates on valid data
authorMathias Krause <minipli@googlemail.com>
Fri, 31 May 2013 21:24:29 +0000 (23:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jun 2013 20:55:02 +0000 (13:55 -0700)
commitf8e7a58ccb5f9fd8d6ffc24a3bef9560159232d4
tree45f73dde89f44a0dd67e26859effd3cbe90286d8
parent3c4184b64bd50c67e1a9c58f1f6da3f8d34d9dd3
debugfs: write_file_bool() - ensure strtobool() operates on valid data

In case, userland writes an empty string to a bool debugfs file, buf[]
will still be uninitialized when being passed to strtobool() making the
outcome of that function purely random.

Fix this by always zero-terminating the buffer.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/debugfs/file.c