diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 7d860a22e5fb..0cddc35e1e87 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1009,10 +1009,14 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, return err; } - if (nlk->ngroups == 0) + if (nlk->ngroups == 0) { groups = 0; - else + } else { + if (groups != (groups & ((1ULL << nlk->ngroups) - 1))) + pr_alert("%s: groups: %#lx ngroups: %u\n", + current->comm, groups, nlk->ngroups); groups &= (1ULL << nlk->ngroups) - 1; + } bound = nlk->bound; if (bound) {