1
0
Fork 0
remarkable-linux/net/netlink
Dmitry Safonov 09901e570c 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
Cc: stable@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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-09 12:16:38 +02:00
..
Kconfig netlink: remove mmapped netlink support 2016-02-18 11:42:18 -05:00
Makefile netlink: Diag core and basic socket info dumping (v2) 2013-03-21 12:38:03 -04:00
af_netlink.c netlink: Don't shift on 64 for ngroups 2018-08-09 12:16:38 +02:00
af_netlink.h af_netlink: ensure that NLMSG_DONE never fails in dumps 2017-11-24 08:37:03 +01:00
diag.c netlink/diag: report flags for netlink sockets 2017-04-05 07:13:56 -07:00
genetlink.c netlink: avoid a double skb free in genlmsg_mcast() 2018-03-31 18:10:41 +02:00