]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
hsr: check protocol version in hsr_newlink()
authorTaehee Yoo <ap420073@gmail.com>
Tue, 7 Apr 2020 13:23:21 +0000 (13:23 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 5 May 2020 10:32:22 +0000 (12:32 +0200)
commit0dbe5464f744c37597988a1d1604feeb45a29ffc
tree45bd3dc3f6fd56a2b5453e2f8d9fc176e19ab21f
parentd2f16ba66dd54364da9a8d8e6e0e49ed1fbd5d05
hsr: check protocol version in hsr_newlink()

BugLink: https://bugs.launchpad.net/bugs/1874111
[ Upstream commit 4faab8c446def7667adf1f722456c2f4c304069c ]

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: ee1c27977284 ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/hsr/hsr_netlink.c