]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: fix off-by-one error
authornikolay@redhat.com <nikolay@redhat.com>
Wed, 31 Oct 2012 04:42:51 +0000 (04:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Nov 2012 15:53:43 +0000 (11:53 -0400)
commitaa5e9e5f46c4974a8898cf3ebfab9af0ff26c175
tree8189b62ba509887a42df4fcc873bb8d4637772cb
parent079132610fde8cb49e20bd9d61197e30f81a0525
bonding: fix off-by-one error

Fix off-by-one error because IFNAMSIZ == 16 and when this
code gets executed we stick a NULL byte where we should not.

How to reproduce:
 with CONFIG_CC_STACKPROTECTOR=y (otherwise it may pass by silently)
 modprobe bonding; echo 1 > /sys/class/net/bond0/bonding/mode;
 echo "AAAAAAAAAAAAAAAA" > /sys/class/net/bond0/bonding/primary;

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_sysfs.c