diff options
author | nikolay@redhat.com <nikolay@redhat.com> | 2012-10-31 05:42:51 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-01 16:53:43 +0100 |
commit | eb6e98a1b25fb0f347fece9814257a9e1cb537c8 (patch) | |
tree | 8189b62ba509887a42df4fcc873bb8d4637772cb /drivers | |
parent | bnx2x: Disable FCoE for 57840 since not yet supported by FW (diff) | |
download | linux-eb6e98a1b25fb0f347fece9814257a9e1cb537c8.tar.xz linux-eb6e98a1b25fb0f347fece9814257a9e1cb537c8.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index dc15d248443f..238d9b3e2252 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -1060,7 +1060,7 @@ static ssize_t bonding_store_primary(struct device *d, goto out; } - sscanf(buf, "%16s", ifname); /* IFNAMSIZ */ + sscanf(buf, "%15s", ifname); /* IFNAMSIZ */ /* check to see if we are clearing primary */ if (!strlen(ifname) || buf[0] == '\n') { |