From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Safonov Subject: Re: [PATCH 4.4 106/124] netlink: Do not subscribe to non-existent groups Date: Sun, 05 Aug 2018 00:26:38 +0100 Message-ID: <1533425198.2679.148.camel@arista.com> References: <20180804082702.434482435@linuxfoundation.org> <20180804082706.427556290@linuxfoundation.org> <20180804180734.GA25546@flashbox> <1533422007.2679.141.camel@arista.com> <20180804224956.GA5384@flashbox> <1533424322.2679.144.camel@arista.com> <20180804232102.GA3982@flashbox> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, "David S. Miller" , Herbert Xu , Steffen Klassert , netdev@vger.kernel.org To: Nathan Chancellor Return-path: In-Reply-To: <20180804232102.GA3982@flashbox> Sender: stable-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Sat, 2018-08-04 at 16:21 -0700, Nathan Chancellor wrote: > On Sun, Aug 05, 2018 at 12:12:02AM +0100, Dmitry Safonov wrote: > > On Sat, 2018-08-04 at 15:49 -0700, Nathan Chancellor wrote: > > > dmesg output attached, please let me know if you need anything > > > else. > > > > Could you try with this diff instead? > > It looks like, I'm too bad with shifts and shifted for 64 bytes. > > > > -- > > Thanks, > > Dmitry > > diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c > > index 7d860a22e5fb..b78bb7dc06fe 100644 > > --- a/net/netlink/af_netlink.c > > +++ b/net/netlink/af_netlink.c > > @@ -1011,7 +1011,7 @@ static int netlink_bind(struct socket *sock, > > struct sockaddr *addr, > > > > if (nlk->ngroups == 0) > > groups = 0; > > - else > > + else if (nlk->ngroups < 64) > > groups &= (1ULL << nlk->ngroups) - 1; > > > > bound = nlk->bound; > > This fixed my issue. If needed: > > Tested-by: Nathan Chancellor > Thanks for the testing, sorry again for the breakage. Will send the patch shortly (with sizeof(unsigned long long) instead of hard-coded 64). Hopefully, not too late. (and then will go to bed and feel myself awful - not knowing C after so many years). -- Thanks, Dmitry