]> git.baikalelectronics.ru Git - kernel.git/commit
pktgen: Limit how much data we copy onto the stack.
authorNelson Elhage <nelhage@ksplice.com>
Thu, 28 Oct 2010 18:31:07 +0000 (11:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Oct 2010 18:47:53 +0000 (11:47 -0700)
commit338164709159175c6e35afb71640dc7fcb8c5b82
tree475844d92c01fae639bda19988ba1375272c857a
parentb087a74b748eece51f491bcb4be275bb3bb08499
pktgen: Limit how much data we copy onto the stack.

A program that accidentally writes too much data to the pktgen file can overflow
the kernel stack and oops the machine. This is only triggerable by root, so
there's no security issue, but it's still an unfortunate bug.

printk() won't print more than 1024 bytes in a single call, anyways, so let's
just never copy more than that much data. We're on a fairly shallow stack, so
that should be safe even with CONFIG_4KSTACKS.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c