diff options
author | nikolay@redhat.com <nikolay@redhat.com> | 2012-10-31 06:03:52 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-01 15:53:44 (GMT) |
commit | c84e1590d149cfc885062e938944941f33e69f38 (patch) | |
tree | 7478368e5070a5fddfb23e68e97dcdccd5d2cda4 | |
parent | eb6e98a1b25fb0f347fece9814257a9e1cb537c8 (diff) | |
download | linux-c84e1590d149cfc885062e938944941f33e69f38.tar.xz |
bonding: fix second 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/active_slave;
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Note: Sorry for the second patch but I missed this one while checking
the file. You can squash them into one patch.
Signed-off-by: David S. Miller <davem@davemloft.net>
-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 238d9b3..ef8d2a0 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -1237,7 +1237,7 @@ static ssize_t bonding_store_active_slave(struct device *d, goto out; } - sscanf(buf, "%16s", ifname); /* IFNAMSIZ */ + sscanf(buf, "%15s", ifname); /* IFNAMSIZ */ /* check to see if we are clearing active */ if (!strlen(ifname) || buf[0] == '\n') { |