linux-stable/net/hsr
Taehee Yoo 3e5eab7f08 hsr: check protocol version in hsr_newlink()
[ Upstream commit 4faab8c446 ]

In the current hsr code, only 0 and 1 protocol versions are valid.
But current hsr code doesn't check the version, which is received by
userspace.

Test commands:
    ip link add dummy0 type dummy
    ip link add dummy1 type dummy
    ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 version 4

In the test commands, version 4 is invalid.
So, the command should be failed.

After this patch, following error will occur.
"Error: hsr: Only versions 0..1 are supported."

Fixes: ee1c279772 ("net/hsr: Added support for HSR v1")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-24 08:00:52 +02:00
..
hsr_device.c hsr: reset network header when supervision frame is created 2020-01-17 19:45:45 +01:00
hsr_device.h net/hsr: Added support for HSR v1 2016-04-15 17:06:48 -04:00
hsr_forward.c hsr: fix incorrect warning 2017-06-12 15:21:20 -04:00
hsr_forward.h net/hsr: Better frame dispatch 2014-07-08 11:35:31 -07:00
hsr_framereg.c hsr: use rcu_read_lock() in hsr_get_node_{list/status}() 2020-04-02 16:34:26 +02:00
hsr_framereg.h net: hsr: fix memory leak in hsr_dev_finalize() 2019-03-19 13:13:22 +01:00
hsr_main.c net/hsr: Fix NULL pointer dereference and refcnt bugs when deleting a HSR interface. 2015-03-01 13:40:23 -05:00
hsr_main.h net/hsr: Added support for HSR v1 2016-04-15 17:06:48 -04:00
hsr_netlink.c hsr: check protocol version in hsr_newlink() 2020-04-24 08:00:52 +02:00
hsr_netlink.h net/hsr: Use list_head (and rcu) instead of array for slave devices. 2014-07-08 11:35:31 -07:00
hsr_slave.c hsr: fix general protection fault in hsr_addr_is_self() 2020-04-02 16:34:23 +02:00
hsr_slave.h net/hsr: Better frame dispatch 2014-07-08 11:35:31 -07:00
Kconfig net/hsr: Added support for HSR v1 2016-04-15 17:06:48 -04:00
Makefile net/hsr: Better frame dispatch 2014-07-08 11:35:31 -07:00