linux/net/netlink
Dmitry Safonov 74749cf4ec netlink: Don't shift on 64 for ngroups
commit 91874ecf32 upstream.

It's legal to have 64 groups for netlink_sock.

As user-supplied nladdr->nl_groups is __u32, it's possible to subscribe
only to first 32 groups.

The check for correctness of .bind() userspace supplied parameter
is done by applying mask made from ngroups shift. Which broke Android
as they have 64 groups and the shift for mask resulted in an overflow.

Fixes: 61f4b23769 ("netlink: Don't shift with UB on nlk->ngroups")
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: netdev@vger.kernel.org
Reported-and-Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:05:54 +00:00
..
af_netlink.c netlink: Don't shift on 64 for ngroups 2018-11-20 18:05:54 +00:00
af_netlink.h netlink: remove mmapped netlink support 2017-04-04 22:21:56 +01:00
diag.c netlink: remove mmapped netlink support 2017-04-04 22:21:56 +01:00
genetlink.c netlink: avoid a double skb free in genlmsg_mcast() 2018-06-16 22:22:11 +01:00
Kconfig netlink: remove mmapped netlink support 2017-04-04 22:21:56 +01:00
Makefile netlink: Diag core and basic socket info dumping (v2) 2013-03-21 12:38:03 -04:00