netlink: Do not subscribe to non-existent groups
Subsystems (2)
PATCH 1/1 netlink: Do not subscribe to non-existent groups
Make ABI more strict about subscribing to group > ngroups. Code doesn't check for that and it looks bogus.
(one can subscribe to non-existing group)
Still, it's possible to bind() to all possible groups with (-1)
Cc "David S. Miller" <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Steffen Klassert <[email protected]>
Signed-off-by Dmitry Safonov <[email protected]>
--- net/netlink/af_netlink.c | 1 + 1 file changed, 1 insertion(+)
net/netlink/af_netlink.c +1 -0
@@ -1008,6 +1008,7 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,if (err)return err; } + groups &= (1UL << nlk->ngroups) -1 ; bound = nlk->bound;if (bound) {
Signature · 1 line
2.13.6
David Miller
maintainerFrom: Dmitry Safonov <[email protected]>
Date: Fri, 27 Jul 2018 16:54:44 +0100
Quoted 10 lines
Make ABI more strict about subscribing to group > ngroups. Code doesn't check for that and it looks bogus.
(one can subscribe to non-existing group)
Still, it's possible tobind()to all possible groups with (-1)Cc "David S. Miller" <[email protected]>Cc Herbert Xu <[email protected]>Cc Steffen Klassert <[email protected]>Signed-off-by Dmitry Safonov <[email protected]>
Applied and queued up for -stable, thanks.