Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1def377 authored by Pablo Neira's avatar Pablo Neira Committed by Matt Wagantall
Browse files

netlink: fix wrong subscription bitmask to group mapping in



The subscription bitmask passed via struct sockaddr_nl is converted to
the group number when calling the netlink_bind() and netlink_unbind()
callbacks.

The conversion is however incorrect since bitmask (1 << 0) needs to be
mapped to group number 1. Note that you cannot specify the group number 0
(usually known as _NONE) from setsockopt() using NETLINK_ADD_MEMBERSHIP
since this is rejected through -EINVAL.

This problem became noticeable since 97840cb6 ("netfilter: nfnetlink:
fix insufficient validation in nfnetlink_bind") when binding to bitmask
(1 << 0) in ctnetlink.

Change-Id: I0eeb926978c8f9be485dc1e069a00430ba63a3aa
Reported-by: default avatarAndre Tomt <andre@tomt.net>
Reported-by: default avatarIvan Delalande <colona@arista.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: 8b7c36d810c61ab16997f4387fc16291410700f8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[mattw@codeaurora.org: resolve conflicts due to added arguments to
netlink_bind/netlink_unbind]
Signed-off-by: default avatarMatt Wagantall <mattw@codeaurora.org>
parent 848b312e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment