linux/net/hsr
Taehee Yoo 22ea267a9c 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-21 09:04:44 +02:00
..
hsr_debugfs.c hsr: rename debugfs file when interface name is changed 2020-01-17 19:48:24 +01:00
hsr_device.c hsr: reset network header when supervision frame is created 2020-01-17 19:48:24 +01:00
hsr_device.h hsr: switch ->dellink() to ->ndo_uninit() 2019-07-11 14:37:45 -07:00
hsr_forward.c net: hsr: add tx stats for master interface 2019-04-15 17:22:02 -07:00
hsr_forward.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00
hsr_framereg.c hsr: use rcu_read_lock() in hsr_get_node_{list/status}() 2020-04-01 11:01:48 +02:00
hsr_framereg.h hsr: fix a race condition in node list insertion and deletion 2020-01-09 10:20:07 +01:00
hsr_main.c hsr: fix slab-out-of-bounds Read in hsr_debugfs_rename() 2020-01-17 19:48:32 +01:00
hsr_main.h hsr: Fix a compilation error 2020-01-29 16:45:30 +01:00
hsr_netlink.c hsr: check protocol version in hsr_newlink() 2020-04-21 09:04:44 +02:00
hsr_netlink.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00
hsr_slave.c hsr: fix general protection fault in hsr_addr_is_self() 2020-04-01 11:01:31 +02:00
hsr_slave.h net: hsr: convert to SPDX identifier 2019-04-06 18:32:21 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00