diff options
author | Mathias Krause <minipli@googlemail.com> | 2014-02-22 00:38:34 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-25 03:54:25 +0400 |
commit | 20b0c718c3bb122107bebadbb8ecf4bab76fb392 (patch) | |
tree | 1408cdb798aacbb27a42fe735b6658289c6004ec /net/core/netevent.c | |
parent | 8bfdfbc188ff46f7495ae05a2bc366943b83393f (diff) | |
download | linux-20b0c718c3bb122107bebadbb8ecf4bab76fb392.tar.xz |
pktgen: fix out-of-bounds access in pgctrl_write()
If a privileged user writes an empty string to /proc/net/pktgen/pgctrl
the code for stripping the (then non-existent) '\n' actually writes the
zero byte at index -1 of data[]. The then still uninitialized array will
very likely fail the command matching tests and the pr_warning() at the
end will therefore leak stack bytes to the kernel log.
Fix those issues by simply ensuring we're passed a non-empty string as
the user API apparently expects a trailing '\n' for all commands.
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netevent.c')
0 files changed, 0 insertions, 0 deletions